diff mbox series

[FFmpeg-devel,2/4] avformat/nutenc: check return of write_headers()

Message ID 20201108195043.210799-2-andriy.gelman@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4] avformat/nutenc: don't use header_count to store different variables
Related show

Checks

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

Commit Message

Andriy Gelman Nov. 8, 2020, 7:50 p.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavformat/nutenc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 87adef6f7e..0646f72af2 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -988,8 +988,11 @@  static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
         data_size += sm_size;
     }
 
-    if (1LL << (20 + 3 * nut->header_rep_count) <= avio_tell(bc))
-        write_headers(s, bc);
+    if (1LL << (20 + 3 * nut->header_rep_count) <= avio_tell(bc)) {
+        ret = write_headers(s, bc);
+        if (ret < 0)
+            goto fail;
+    }
 
     if (key_frame && !(nus->last_flags & FLAG_KEY))
         store_sp = 1;