[FFmpeg-cvslog] avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()

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


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Fri May 17 23:53:28 2024 +0200| [9e5d40ff9f83eae59dd8dfb8f4009289329b2a8b] | committer: Michael Niedermayer

avcodec/tiff: Assert init_get_bits8() success in horizontal_fill()

Helps: CID1441167 Unchecked return value

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

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

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

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index b3583537ed..f3240bf95a 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -317,7 +317,8 @@ static void av_always_inline horizontal_fill(TiffContext *s,
             uint8_t shift = is_dng ? 0 : 16 - bpp;
             GetBitContext gb;
 
-            init_get_bits8(&gb, src, width);
+            int ret = init_get_bits8(&gb, src, width);
+            av_assert1(ret >= 0);
             for (int i = 0; i < s->width; i++) {
                 dst16[i] = get_bits(&gb, bpp) << shift;
             }



More information about the ffmpeg-cvslog mailing list