[FFmpeg-cvslog] avcodec/notchlc: Check init_get_bits8() for failure

Michael Niedermayer git at videolan.org
Fri Jun 14 22:20:50 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon May 13 00:45:29 2024 +0200| [32fc533b2c12d6f4b27535641995e474b16a8aa1] | committer: Michael Niedermayer

avcodec/notchlc: Check init_get_bits8() for failure

Fixes: CID1500300 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 19db9636c52c040d364fe9af94ddeeb1ecfd2c2a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/notchlc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/notchlc.c b/libavcodec/notchlc.c
index 9e6534339f..05db9e4943 100644
--- a/libavcodec/notchlc.c
+++ b/libavcodec/notchlc.c
@@ -240,7 +240,9 @@ static int decode_blocks(AVCodecContext *avctx, AVFrame *p, ThreadFrame *frame,
 
         bytestream2_seek(&dgb, s->y_data_offset + row_offset, SEEK_SET);
 
-        init_get_bits8(&bit, dgb.buffer, bytestream2_get_bytes_left(&dgb));
+        ret = init_get_bits8(&bit, dgb.buffer, bytestream2_get_bytes_left(&dgb));
+        if (ret < 0)
+            return ret;
         for (int x = 0; x < avctx->width; x += 4) {
             unsigned item = bytestream2_get_le32(gb);
             unsigned y_min = item & 4095;



More information about the ffmpeg-cvslog mailing list