diff mbox series

[FFmpeg-devel,3/6] avformat/matroskaenc: Forward errors from avpriv_split_xiph_headers()

Message ID 20200517231319.13067-3-andreas.rheinhardt@gmail.com
State Accepted
Commit a5572f5a80abdf71c222926dc163182aec84e105
Headers show
Series [FFmpeg-devel,1/6] avformat/segment: Access AVStream more directly
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 17, 2020, 11:13 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/matroskaenc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 99b549ecc4..1b6e80da36 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -603,17 +603,18 @@  static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb,
     const uint8_t *header_start[3];
     int header_len[3];
     int first_header_size;
-    int j;
+    int err, j;
 
     if (par->codec_id == AV_CODEC_ID_VORBIS)
         first_header_size = 30;
     else
         first_header_size = 42;
 
-    if (avpriv_split_xiph_headers(par->extradata, par->extradata_size,
-                              first_header_size, header_start, header_len) < 0) {
+    err = avpriv_split_xiph_headers(par->extradata, par->extradata_size,
+                                    first_header_size, header_start, header_len);
+    if (err < 0) {
         av_log(s, AV_LOG_ERROR, "Extradata corrupt.\n");
-        return -1;
+        return err;
     }
 
     avio_w8(pb, 2);                    // number packets - 1