You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/imm4: Unreference previous frame on frame size change
Fixes: Out of array access Fixes: 13552/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5767949648920576 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:
@@ -446,12 +446,14 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frame->key_frame &&
|
if (avctx->width != width ||
|
||||||
(avctx->width != width ||
|
avctx->height != height) {
|
||||||
avctx->height != height)) {
|
if (!frame->key_frame) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Frame size change is unsupported.\n");
|
av_log(avctx, AV_LOG_ERROR, "Frame size change is unsupported.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
av_frame_unref(s->prev_frame);
|
||||||
|
}
|
||||||
|
|
||||||
ret = ff_set_dimensions(avctx, width, height);
|
ret = ff_set_dimensions(avctx, width, height);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user