avcodec/libx264: Check init_get_bits8() return code

Fixes: CID1594529 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-10 03:48:10 +02:00
parent 8a64a003b5
commit dce69ba89e
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 1 deletions

View File

@ -922,7 +922,9 @@ static int set_avcc_extradata(AVCodecContext *avctx, x264_nal_t *nal, int nnal)
*
* +4 to skip until sps id.
*/
init_get_bits8(&gbc, sps + 4, sps_nal->i_payload - 4 - 4);
ret = init_get_bits8(&gbc, sps + 4, sps_nal->i_payload - 4 - 4);
if (ret < 0)
return ret;
// Skip sps id
get_ue_golomb_31(&gbc);
chroma_format_idc = get_ue_golomb_31(&gbc);