[FFmpeg-cvslog] mpegenc: prevent a NULL pointer dereference

Vittorio Giovara git at videolan.org
Sun Jan 18 02:23:36 CET 2015


ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Nov 21 12:57:42 2014 +0000| [cce99f72d1b49d3dfee859136eeff3db32553750] | committer: Luca Barbato

mpegenc: prevent a NULL pointer dereference

CC: libav-stable at libav.org
Bug-Id: CID 29261
(cherry picked from commit 065923b0781b06a2604f69f4e2c2407b7750a854)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cce99f72d1b49d3dfee859136eeff3db32553750
---

 libavformat/mpegenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 88590b3..8a62c54 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1052,7 +1052,7 @@ retry:
         es_size              -= stream->premux_packet->unwritten_size;
         stream->premux_packet = stream->premux_packet->next;
     }
-    if (es_size)
+    if (stream->premux_packet && es_size)
         stream->premux_packet->unwritten_size -= es_size;
 
     if (remove_decoded_packets(ctx, s->last_scr) < 0)



More information about the ffmpeg-cvslog mailing list