[FFmpeg-cvslog] avcodec/avs3_parser: assert the return value of init_get_bits()
Michael Niedermayer
git at videolan.org
Thu Jun 13 23:40:29 EEST 2024
ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed May 1 21:17:25 2024 +0200| [d71036b4559cecb5e1d8cb989b47d858d52921bc] | committer: Michael Niedermayer
avcodec/avs3_parser: assert the return value of init_get_bits()
Fixes: CID1492867 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit f9218e4d52e16494ed816651a110dfe0ad22638c)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d71036b4559cecb5e1d8cb989b47d858d52921bc
---
libavcodec/avs3_parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
index a9fd879e9d..cd667967b6 100644
--- a/libavcodec/avs3_parser.c
+++ b/libavcodec/avs3_parser.c
@@ -73,7 +73,8 @@ static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf,
GetBitContext gb;
int profile, ratecode, low_delay;
- init_get_bits8(&gb, buf + 4, buf_size - 4);
+ av_unused int ret = init_get_bits(&gb, buf + 4, 100);
+ av_assert1(ret >= 0);
s->key_frame = 1;
s->pict_type = AV_PICTURE_TYPE_I;
More information about the ffmpeg-cvslog
mailing list