diff mbox series

[FFmpeg-devel,4/4] avformat/mpegenc: Forward error code

Message ID 20210215145423.591629-3-andreas.rheinhardt@gmail.com
State Accepted
Commit d150c2038d18d0cab6e646b3990d63920d20fb3b
Headers show
Series [FFmpeg-devel,1/4] avformat/mpegenc: Ensure packet queue stays valid | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Feb. 15, 2021, 2:54 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/mpegenc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 14b904b152..d37f181eaa 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1151,7 +1151,7 @@  static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     StreamInfo *stream = st->priv_data;
     int64_t pts, dts;
     PacketDesc *pkt_desc;
-    int preload;
+    int preload, ret;
     const int is_iframe = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
                           (pkt->flags & AV_PKT_FLAG_KEY);
 
@@ -1207,8 +1207,9 @@  static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     pkt_desc->unwritten_size =
     pkt_desc->size           = size;
 
-    if (av_fifo_realloc2(stream->fifo, av_fifo_size(stream->fifo) + size) < 0)
-        return -1;
+    ret = av_fifo_realloc2(stream->fifo, av_fifo_size(stream->fifo) + size);
+    if (ret < 0)
+        return ret;
 
     if (s->is_dvd) {
         // min VOBU length 0.4 seconds (mpucoder)