[FFmpeg-cvslog] avcodec/libx264: Check init_get_bits8() return code

Michael Niedermayer git at videolan.org
Fri Jun 7 22:48:06 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri May 10 03:48:10 2024 +0200| [dce69ba89e37a956236b30663be893b7dae1567b] | committer: Michael Niedermayer

avcodec/libx264: Check init_get_bits8() return code

Fixes: CID1594529 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

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);



More information about the ffmpeg-cvslog mailing list