Fix memory exhaustion bug

This commit is contained in:
Birk Tjelmeland committed 2019-02-27 16:15:57 +01:00
1 parent ff26217534
commit d637e1f7f6
3 files changed
+75 -6

No files matched your search

+5
View File
@@ -18,6 +18,9 @@ pub enum TiffError {
/// An I/O Error occurred while decoding the image
IoError(io::Error),
/// The Limits of the Decoder is exceeded,
LimitsExceeded,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -89,6 +92,7 @@ impl fmt::Display for TiffError {
TiffError::UnsupportedError(ref f) => write!(fmt, "The Decoder does not support the \
image format `{}`", f),
TiffError::IoError(ref e) => e.fmt(fmt),
TiffError::LimitsExceeded => write!(fmt, "The Decoder limits are exceeded"),
}
}
}
@@ -99,6 +103,7 @@ impl Error for TiffError {
TiffError::FormatError(..) => "Format error",
TiffError::UnsupportedError(..) => "Unsupported error",
TiffError::IoError(..) => "IO error",
TiffError::LimitsExceeded => "Decoder limits exceeded",
}
}