mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
avcodec/cdtoons: Check sprite_offset is within the packet
Fixes: out of array read Fixes: 20659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDTOONS_fuzzer-5754518731227136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
19738b1bc2
commit
4d701e9222
1 changed files with 3 additions and 0 deletions
|
|
@ -190,6 +190,9 @@ static int cdtoons_decode_frame(AVCodecContext *avctx, void *data,
|
|||
palette_set = bytestream_get_byte(&buf);
|
||||
buf += 5;
|
||||
|
||||
if (sprite_offset > buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* read new sprites introduced in this frame */
|
||||
buf = avpkt->data + sprite_offset;
|
||||
while (sprite_count--) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue