diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-05-10 03:48:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-07 21:42:25 +0200 |
commit | dce69ba89e37a956236b30663be893b7dae1567b (patch) | |
tree | 90a62f245190409f5df848df7d328229502fb988 | |
parent | 8a64a003b5d567354e82af679e056615c8464a6f (diff) | |
download | ffmpeg-dce69ba89e37a956236b30663be893b7dae1567b.tar.gz |
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>
-rw-r--r-- | libavcodec/libx264.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 29d1a7ccbc..8186f68aec 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -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); |