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>
This commit is contained in:
Michael Niedermayer 2017-05-21 15:34:21 +02:00
parent ea71a48c7e
commit 4dc3714c48
2 changed files with 5 additions and 16 deletions

View File

@ -235,16 +235,13 @@ 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) {
// Skip duplicate frames
return buf_size;
}
if (frame_type == 0) {
*got_frame = 1;
if ((ret = av_frame_ref(data, c->pic)) < 0)
return ret;
return buf_size;
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
return ret;
}
if (bytestream2_get_bytes_left(&gb) < 4) {

View File

@ -5,33 +5,25 @@
#sar 0: 0/1
0, 0, 0, 1, 230400, 0x7a2103c0
0, 1, 1, 1, 230400, 0xd381c279
0, 2, 2, 1, 230400, 0xd381c279
0, 3, 3, 1, 230400, 0x110aec27
0, 4, 4, 1, 230400, 0x4be67ee7
0, 5, 5, 1, 230400, 0xd87fe4b4
0, 6, 6, 1, 230400, 0xd87fe4b4
0, 7, 7, 1, 230400, 0x9bc6a398
0, 8, 8, 1, 230400, 0xd67d92db
0, 9, 9, 1, 230400, 0x3df6559e
0, 10, 10, 1, 230400, 0x3df6559e
0, 11, 11, 1, 230400, 0x2136ff25
0, 12, 12, 1, 230400, 0x94573fe6
0, 13, 13, 1, 230400, 0xbf67d3f5
0, 14, 14, 1, 230400, 0xbf67d3f5
0, 15, 15, 1, 230400, 0x2592b5cf
0, 16, 16, 1, 230400, 0x5b23cd93
0, 17, 17, 1, 230400, 0x9b76d079
0, 18, 18, 1, 230400, 0x9b76d079
0, 19, 19, 1, 230400, 0x771a017e
0, 20, 20, 1, 230400, 0xacfee1d0
0, 21, 21, 1, 230400, 0x6b9ff4eb
0, 22, 22, 1, 230400, 0x6b9ff4eb
0, 23, 23, 1, 230400, 0xbaf643e1
0, 24, 24, 1, 230400, 0x052efe59
0, 25, 25, 1, 230400, 0xd751f901
0, 26, 26, 1, 230400, 0xd751f901
0, 27, 27, 1, 230400, 0x6f94e11f
0, 28, 28, 1, 230400, 0x17eeabb9
0, 29, 29, 1, 230400, 0x3733a035
0, 30, 30, 1, 230400, 0x3733a035
0, 31, 31, 1, 230400, 0xb0829f45