aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-02-13 17:20:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-02-13 17:20:46 +0100
commit2034ba08ec8d7d3eb66d83622a817f6bd2361c4f (patch)
tree9245d2c5d06668cb749687f0eb372a5edea7e4a6
parent0a18b64585ca3f9181229dcc4ccb62bc6b939679 (diff)
downloadffmpeg-2034ba08ec8d7d3eb66d83622a817f6bd2361c4f.tar.gz
Detect null gop headers.
Fix issue2592. / mpeg4-bad-gvop.raw
-rw-r--r--libavcodec/mpeg4videodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 673c4e865c..71b4622109 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1495,6 +1495,11 @@ end:
static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){
int hours, minutes, seconds;
+ if(!show_bits(gb, 18)){
+ av_log(s->avctx, AV_LOG_WARNING, "GOP header invalid\n");
+ return -1;
+ }
+
hours= get_bits(gb, 5);
minutes= get_bits(gb, 6);
skip_bits1(gb);