Skip to content

Commit 63f7170

Browse files
committed
LJpegDecoder: Maximal output tile size should be a multiple of LJpeg frame size
1 parent 3ee4910 commit 63f7170

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/librawspeed/decompressors/LJpegDecoder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ Buffer::size_type LJpegDecoder::decodeScan() {
132132
if (maxRes.area() != N_COMP * jpegFrame.dim.area())
133133
ThrowRDE("LJpeg frame area does not match maximal tile area");
134134

135+
if (maxRes.x % jpegFrame.dim.x != 0 || maxRes.y % jpegFrame.dim.y != 0)
136+
ThrowRDE("Maximal output tile size is not a multiple of LJpeg frame size");
137+
135138
int numRowsPerRestartInterval;
136139
if (numMCUsPerRestartInterval == 0) {
137140
// Restart interval not enabled, so all of the rows

0 commit comments

Comments
 (0)