diff mbox series

[FFmpeg-devel,1/3] avformat/jpegxl_probe: Check init_get_bits8() for failure

Message ID 20220516011605.18792-1-michael@niedermayer.cc
State Accepted
Commit cb5be590cd115b7831c9cbcfe4961a7e8ff65420
Headers show
Series [FFmpeg-devel,1/3] avformat/jpegxl_probe: Check init_get_bits8() for failure | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer May 16, 2022, 1:16 a.m. UTC
Fixes: missing error check
Fixes: CID1504270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/jpegxl_probe.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer May 26, 2022, 9:03 a.m. UTC | #1
On Mon, May 16, 2022 at 03:16:03AM +0200, Michael Niedermayer wrote:
> Fixes: missing error check
> Fixes: CID1504270
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/jpegxl_probe.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/jpegxl_probe.c b/libavformat/jpegxl_probe.c
index 9cd00da194..3de002f004 100644
--- a/libavformat/jpegxl_probe.c
+++ b/libavformat/jpegxl_probe.c
@@ -250,8 +250,11 @@  int ff_jpegxl_verify_codestream_header(const uint8_t *buf, int buflen)
     int xyb_encoded = 1, have_icc_profile = 0;
     uint32_t num_extra_channels;
     uint64_t extensions;
+    int ret;
 
-    init_get_bits8(gb, buf, buflen);
+    ret = init_get_bits8(gb, buf, buflen);
+    if (ret < 0)
+        return ret;
 
     if (jxl_bits(16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE)
         return -1;