diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-04-16 23:34:42 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-04-16 23:34:42 +0200 |
| commit | e46e6c6054e4294c35d0f5e17de251b2fbb94cdc (patch) | |
| tree | d0e50ab76520dcf21a80b4800b3f05271b53dea6 /src/verify.h | |
| parent | eda64d142769ca4e81578fc1dc59e265eac28ac7 (diff) | |
Check for tile parts being too big in the verifier (DoM #2450).
Diffstat (limited to 'src/verify.h')
| -rw-r--r-- | src/verify.h | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/src/verify.h b/src/verify.h index 8eec9749..4d65fae7 100644 --- a/src/verify.h +++ b/src/verify.h @@ -436,7 +436,13 @@ public: /** An interop subtitle file has a <LoadFont> node which refers to a font file that is not found. * note contains the <LoadFont> ID */ - MISSING_FONT + MISSING_FONT, + /** A tile part in a JPEG2000 frame is too big. + * frame contains the frame index (counted from 0) + * component contains the component index (0, 1 or 2) + * size contains the invalid size in bytes. + */ + INVALID_JPEG2000_TILE_PART_SIZE, }; VerificationNote (Type type, Code code) @@ -485,9 +491,12 @@ public: private: enum class Data { - NOTE, ///< further information about the error - FILE, ///< path of file containing the error - LINE ///< error line number within the FILE + NOTE, ///< further information about the error + FILE, ///< path of file containing the error + LINE, ///< error line number within the FILE + FRAME, + COMPONENT, + SIZE, }; template <class T> @@ -513,6 +522,33 @@ public: return data<uint64_t>(Data::LINE); } + VerificationNote& set_frame(int frame) { + _data[Data::FRAME] = frame; + return *this; + } + + boost::optional<int> frame() const { + return data<int>(Data::FRAME); + } + + VerificationNote& set_component(int component) { + _data[Data::COMPONENT] = component; + return *this; + } + + boost::optional<int> component() const { + return data<int>(Data::COMPONENT); + } + + VerificationNote& set_size(int size) { + _data[Data::SIZE] = size; + return *this; + } + + boost::optional<int> size() const { + return data<int>(Data::SIZE); + } + private: Type _type; Code _code; |
