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@niedermayer.cc>
(cherry picked from commit a287f17db2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-17 23:58:30 +02:00
parent 97411b1790
commit 8cb6ff56c2
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 1 deletions

View File

@ -327,7 +327,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);