summaryrefslogtreecommitdiff
path: root/tvg/src/lib.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-02-13 00:53:32 -0500
committerMicha White <botahamec@outlook.com>2023-02-13 00:53:32 -0500
commit38008d6a84457afad717e4524adcf963305fb0b7 (patch)
treec0196bf816f04d10d8ab1843fa33b67fb14d8ab6 /tvg/src/lib.rs
parent89aa6df441d806d6b3d32bc87cf34daf418cf06d (diff)
check for non-zero padding
Diffstat (limited to 'tvg/src/lib.rs')
-rw-r--r--tvg/src/lib.rs16
1 files changed, 9 insertions, 7 deletions
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<C: Color + std::fmt::Debug> TvgFile<C> {
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),