From 1d242f9816ac8e17a74d2f77bd903fa8076d267a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 24 Nov 2014 16:52:19 +0100 Subject: [PATCH] avformat/mpegenc: assert that premux_packet is non null Based on: 065923b0781b06a2604f69f4e2c2407b7750a854 Signed-off-by: Michael Niedermayer --- libavformat/mpegenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index d3af9e1ea7..b1515064e8 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -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;