Fixes: out of array access Fixes: 59999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5767982157266944
Unified · Split
| @@ -295,7 +295,7 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb · 294 unmodified lines | ||
| 295 | 295 | int hsub = i ? s->chroma_x_shift : 0; |
| 296 | 296 | int lowres = s->avctx->lowres; |
| 297 | 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 | 299 | for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){ |
| 300 | 300 | for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step) |
| 301 | 301 | dest_pcm[i][w] = src[idx]; |