Fixes: out of array read in the chroma plane Fixes: 428034092/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_DEC_fuzzer-5582608941776896.test
Unified · Split
| @@ -557,7 +557,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, · 556 unmodified lines | ||
| 557 | 557 | ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x; |
| 558 | 558 | |
| 559 | 559 | if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 || |
| 560 | − (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - FFMAX(h, hc<<s->chroma_y_shift), 0)) { | |
| 560 | + (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - FFMAX(h, field_select + hc<<s->chroma_y_shift), 0)) { | |
| 561 | 561 | s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, |
| 562 | 562 | linesize >> field_based, linesize >> field_based, |
| 563 | 563 | 17, 17 + field_based, |