avcodec/pafvideo: Fix assertion failure
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 6 Jun 2017 14:21:37 +0000 (16:21 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 6 Jun 2017 14:56:40 +0000 (16:56 +0200)
Fixes: 2100/clusterfuzz-testcase-minimized-4522961547558912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c4360559ee2a6c8c624f24fc7e2a1cf00972ba68)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pafvideo.c

index 1618a3e..91bfe16 100644 (file)
@@ -273,7 +273,7 @@ static int paf_video_decode(AVCodecContext *avctx, void *data,
     bytestream2_init(&c->gb, pkt->data, pkt->size);
 
     code = bytestream2_get_byte(&c->gb);
-    if ((code & 0xF) > 4) {
+    if ((code & 0xF) > 4 || (code & 0xF) == 3) {
         avpriv_request_sample(avctx, "unknown/invalid code");
         return AVERROR_INVALIDDATA;
     }