[FFmpeg-cvslog] avcodec/tiff: Assert init_get_bits8() success in unpack_gray()
Michael Niedermayer
git at videolan.org
Thu Jun 13 23:41:31 EEST 2024
ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Fri May 17 23:58:30 2024 +0200| [bc5b55a4caadfd4458dd4a73c2885fc19cad9863] | committer: Michael Niedermayer
avcodec/tiff: Assert init_get_bits8() success in unpack_gray()
Helps: CID1441939 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a287f17db22c0c85f0445a1d31139cc70e73205e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc5b55a4caadfd4458dd4a73c2885fc19cad9863
---
libavcodec/tiff.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 0e18a04f09..8a649ee5be 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -445,7 +445,8 @@ static void unpack_gray(TiffContext *s, AVFrame *p,
GetBitContext gb;
uint16_t *dst = (uint16_t *)(p->data[0] + lnum * p->linesize[0]);
- 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++) {
dst[i] = get_bits(&gb, bpp);
More information about the ffmpeg-cvslog
mailing list