diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-21 15:34:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-25 14:30:04 +0200 |
commit | 4dc3714c48e74e75a3a9c7d9fb52fd5917107508 (patch) | |
tree | ae40a7f58cb6dc89bb757457e35986b762210a28 /libavcodec/tscc2.c | |
parent | ea71a48c7e8a76ee447fa518cca087df9288288d (diff) |
avcodec/tscc2: Skip duplicate frames
This turns CFR duplicated frames into skiped frames
Fixes: Timeout
Fixes: 1719/clusterfuzz-testcase-minimized-6375090079924224
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/tscc2.c')
-rw-r--r-- | libavcodec/tscc2.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index f64c76507e..a8c7ee7996 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -235,18 +235,15 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) { - return ret; - } - if (frame_type == 0) { - *got_frame = 1; - if ((ret = av_frame_ref(data, c->pic)) < 0) - return ret; - + // Skip duplicate frames return buf_size; } + if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) { + return ret; + } + if (bytestream2_get_bytes_left(&gb) < 4) { av_log(avctx, AV_LOG_ERROR, "Frame is too short\n"); return AVERROR_INVALIDDATA; |