]> git.sesse.net Git - ffmpeg/commitdiff
mpegvideo: clear overread in clear_context
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sat, 14 Nov 2015 21:46:46 +0000 (22:46 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sun, 15 Nov 2015 09:26:48 +0000 (10:26 +0100)
Otherwise the h263p decoder can try to copy overread bytes, even though
buffer is NULL.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavcodec/mpegvideo.c

index 69e0595db9cd9f5ffce457ff4355e1819176e911..60e19ffdedae51804b3a1eff6ce5e3f8bf4c7222 100644 (file)
@@ -824,6 +824,7 @@ static void clear_context(MpegEncContext *s)
 
     s->parse_context.buffer = NULL;
     s->parse_context.buffer_size = 0;
+    s->parse_context.overread = 0;
     s->bitstream_buffer = NULL;
     s->allocated_bitstream_buffer_size = 0;
     s->picture          = NULL;