Skip to content

Commit

Permalink
LJpegDecoder: check that frame/tile areas match, not dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed Mar 25, 2024
1 parent 8297c38 commit 3ee4910
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librawspeed/decompressors/LJpegDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ Buffer::size_type LJpegDecoder::decodeScan() {
const LJpegDecompressor::Frame jpegFrame = {N_COMP,
iPoint2D(frame.w, frame.h)};

if (iPoint2D(mRaw->getCpp() * maxDim.x, maxDim.y) !=
iPoint2D(N_COMP * frame.w, frame.h))
ThrowRDE("LJpeg frame does not match maximal tile size");
auto maxRes = iPoint2D(mRaw->getCpp() * maxDim.x, maxDim.y);
if (maxRes.area() != N_COMP * jpegFrame.dim.area())
ThrowRDE("LJpeg frame area does not match maximal tile area");

int numRowsPerRestartInterval;
if (numMCUsPerRestartInterval == 0) {
Expand Down

0 comments on commit 3ee4910

Please sign in to comment.