[FFmpeg-cvslog] mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
Andreas Cadhalpun
git at videolan.org
Sat Apr 4 03:31:14 CEST 2015
ffmpeg | branch: master | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Fri Apr 3 19:14:16 2015 +0200| [f62880bfb8c72ccbfdce4dd9daf93af691060ddd] | committer: Michael Niedermayer
mpeg4: use a self-explanatory #define MAX_NVOP_SIZE
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f62880bfb8c72ccbfdce4dd9daf93af691060ddd
---
libavcodec/h263dec.c | 2 +-
libavcodec/mpeg4video.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index a1981a3..c28a465 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -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
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index e83692c..43650bb 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -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;
More information about the ffmpeg-cvslog
mailing list