History

avcodec/mpeg4videodec: consider lowres in dest_pcm[]

Fixes: out of array access Fixes: 59999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5767982157266944

Michael Niedermayer committed 3 years ago

Commit d4847611 parent 94bd1791 file · +1 −1Browse files

Unified · Split

libavcodec/mpeg4videodec.c+1−1
@@ -295,7 +295,7 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb · 294 unmodified lines
295 int hsub = i ? s->chroma_x_shift : 0;295 int hsub = i ? s->chroma_x_shift : 0;
296 int lowres = s->avctx->lowres;296 int lowres = s->avctx->lowres;
297 int step = 1 << lowres;297 int step = 1 << lowres;
298 dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub) - 1);298 dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub + lowres) - 1);
299 for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){299 for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){
300 for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step)300 for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step)
301 dest_pcm[i][w] = src[idx];301 dest_pcm[i][w] = src[idx];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t