diff mbox

[FFmpeg-devel,1/2] avcodec/arbc: Skip unchanged frames

Message ID 20190414110504.19222-1-michael@niedermayer.cc
State Accepted
Commit 8b10f09fd537aa1d8d775a04f3f294c30986ab07
Headers show

Commit Message

Michael Niedermayer April 14, 2019, 11:05 a.m. UTC
Fixes: Timeout (16sec -> 5sec)
Fixes: 14128/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5767365721063424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/arbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer April 24, 2019, 10:44 a.m. UTC | #1
On Sun, Apr 14, 2019 at 01:05:03PM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (16sec -> 5sec)
> Fixes: 14128/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5767365721063424
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/arbc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]
diff mbox

Patch

diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
index a8b0bb0d8b..08d3a0ae6b 100644
--- a/libavcodec/arbc.c
+++ b/libavcodec/arbc.c
@@ -121,7 +121,7 @@  static int decode_frame(AVCodecContext *avctx, void *data,
     bytestream2_skip(&s->gb, 8);
     nb_segments = bytestream2_get_le16(&s->gb);
     if (nb_segments == 0)
-        keyframe = 0;
+        return avpkt->size;
 
     if (7 * nb_segments > bytestream2_get_bytes_left(&s->gb))
         return AVERROR_INVALIDDATA;