X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftscc2.c;h=a8c7ee7996159377eb2083c47604b88cd7f94a44;hb=e091b9b3c7859030f2896ca2ae96faa3afc694a1;hp=f64c76507ec48614400817f15e131cd28d221c54;hpb=dfbfbbfa48ca0aa34a1ee63de38d6e6b6647bfc9;p=ffmpeg diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index f64c76507ec..a8c7ee79961 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;