mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/mpegvideo_enc: Do not duplicate pictures on shifting
Fixes: out of array access Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752 Fixes: 69599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4848626296225792.fuzz Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a7f5845a6c
commit
9c8881cb35
@ -1304,6 +1304,8 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
|
||||
/* shift buffer entries */
|
||||
for (int i = flush_offset; i <= MAX_B_FRAMES; i++)
|
||||
s->input_picture[i - flush_offset] = s->input_picture[i];
|
||||
for (int i = MAX_B_FRAMES + 1 - flush_offset; i <= MAX_B_FRAMES; i++)
|
||||
s->input_picture[i] = NULL;
|
||||
|
||||
s->input_picture[encoding_delay] = pic;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user