From 38008d6a84457afad717e4524adcf963305fb0b7 Mon Sep 17 00:00:00 2001 From: Micha White Date: Mon, 13 Feb 2023 00:53:32 -0500 Subject: check for non-zero padding --- tvg/src/lib.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tvg/src/lib.rs') diff --git a/tvg/src/lib.rs b/tvg/src/lib.rs index 3b585d7..6b07ff0 100644 --- a/tvg/src/lib.rs +++ b/tvg/src/lib.rs @@ -77,19 +77,21 @@ impl TvgFile { pub enum TvgError { #[error("Not a valid TVG file. The magic number was invalid.")] InvalidFile, - #[error("Expected version 1, but found version {}", .0)] + #[error("Expected version 1, but found version {}.", .0)] UnsupportedVersion(u8), - #[error("Found a coordinate range with an index of 3, which is invalid")] + #[error("Found a coordinate range with an index of 3, which is invalid.")] InvalidCoordinateRange, - #[error("Found a Custom color encoding, which is unsupported")] + #[error("Found a Custom color encoding, which is unsupported.")] UnsupportedColorEncoding, - #[error("Found a command with an index of {}, which is invalid", .0)] + #[error("Found a command with an index of {}, which is invalid.", .0)] InvalidCommand(u8), - #[error("Found a style kind with an index of 3, which is invalid")] + #[error("Found a style kind with an index of 3, which is invalid.")] InvalidStyleKind, - #[error("Polygons must have at least 3 points, found {}", .0)] + #[error("Polygons must have at least 3 points, found {}.", .0)] InvalidPolygon(u32), - #[error("The end of the document must have a `prim_style_kind` value of 0. Found {}", .0)] + #[error("All padding bits must be zero. Found {}.", .0)] + NonZeroPadding(u8), + #[error("The end of the document must have a `prim_style_kind` value of 0. Found {}.", .0)] InvalidEndOfDocument(u8), #[error("{}", .0)] IoError(#[from] io::Error), -- cgit v1.2.3