[FFmpeg-cvslog] avformat/jpegxl_probe: Forward error codes

Michael Niedermayer git at videolan.org
Mon Oct 30 02:09:58 EET 2023


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun  8 10:26:35 2023 -0400| [537600e78506ca4268c860ba5f21dc15d890e5b8] | committer: Michael Niedermayer

avformat/jpegxl_probe: Forward error codes

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 09621fd7d93a12974e9664b2aebb8237e5c46f03)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=537600e78506ca4268c860ba5f21dc15d890e5b8
---

 libavformat/jpegxl_probe.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libavformat/jpegxl_probe.c b/libavformat/jpegxl_probe.c
index 47c6c54ff4..2d2d128387 100644
--- a/libavformat/jpegxl_probe.c
+++ b/libavformat/jpegxl_probe.c
@@ -261,8 +261,8 @@ int ff_jpegxl_verify_codestream_header(const uint8_t *buf, int buflen)
     if (get_bits_long(gb, 16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE)
         return -1;
 
-    if (jpegxl_read_size_header(gb) < 0)
-        return -1;
+    if ((ret = jpegxl_read_size_header(gb)) < 0)
+        return ret;
 
     all_default = get_bits1(gb);
     if (!all_default)
@@ -281,8 +281,9 @@ int ff_jpegxl_verify_codestream_header(const uint8_t *buf, int buflen)
 
         /* preview header */
         if (get_bits1(gb)) {
-            if (jpegxl_read_preview_header(gb) < 0)
-                return -1;
+            ret = jpegxl_read_preview_header(gb);
+            if (ret < 0)
+                return ret;
         }
 
         /* animation header */
@@ -307,8 +308,9 @@ int ff_jpegxl_verify_codestream_header(const uint8_t *buf, int buflen)
         if (num_extra_channels > 4)
             return -1;
         for (uint32_t i = 0; i < num_extra_channels; i++) {
-            if (jpegxl_read_extra_channel_info(gb) < 0)
-                return -1;
+            ret = jpegxl_read_extra_channel_info(gb);
+            if (ret < 0)
+                return ret;
             if (get_bits_left(gb) < 1)
                 return AVERROR_INVALIDDATA;
         }



More information about the ffmpeg-cvslog mailing list