avformat/mpegenc: assert that premux_packet is non null
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 24 Nov 2014 15:52:19 +0000 (16:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 24 Nov 2014 15:54:06 +0000 (16:54 +0100)
Based on: 065923b0781b06a2604f69f4e2c2407b7750a854
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpegenc.c

index d3af9e1..b151506 100644 (file)
@@ -1080,8 +1080,10 @@ retry:
         es_size              -= stream->premux_packet->unwritten_size;
         stream->premux_packet = stream->premux_packet->next;
     }
-    if (es_size)
+    if (es_size) {
+        av_assert0(stream->premux_packet);
         stream->premux_packet->unwritten_size -= es_size;
+    }
 
     if (remove_decoded_packets(ctx, s->last_scr) < 0)
         return -1;