mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Fri, 3 Apr 2015 17:14:16 +0000 (19:14 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Apr 2015 00:23:58 +0000 (02:23 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h263dec.c
libavcodec/mpeg4video.h

index a1981a3..c28a465 100644 (file)
@@ -459,7 +459,7 @@ retry:
         }
     }
 
-    if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder
+    if (s->bitstream_buffer_size && (s->divx_packed || buf_size <= MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder
         ret = init_get_bits8(&s->gb, s->bitstream_buffer,
                              s->bitstream_buffer_size);
     else
index e83692c..43650bb 100644 (file)
@@ -59,6 +59,9 @@
 #define VISUAL_OBJ_STARTCODE 0x1B5
 #define VOP_STARTCODE        0x1B6
 
+/* smaller packets likely don't contain a real frame */
+#define MAX_NVOP_SIZE 19
+
 typedef struct Mpeg4DecContext {
     MpegEncContext m;