mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-04 15:10:39 +00:00
lavc/qdrw: Fix overwrite when reading invalid Quickdraw images.
This commit is contained in:
@@ -95,6 +95,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
|
||||
pos -= offset;
|
||||
pos++;
|
||||
}
|
||||
if (pos >= offset)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
left -= 2;
|
||||
} else { /* copy */
|
||||
@@ -105,6 +107,8 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
|
||||
pos -= offset;
|
||||
pos++;
|
||||
}
|
||||
if (pos >= offset)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
left -= 2 + code;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user