mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/avs2_parser: Assert init_get_bits8() success with const size 15
Fixes: CID1506708 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a7c4f119c9
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
19e6b871b6
commit
e886fe5542
@ -72,13 +72,15 @@ static void parse_avs2_seq_header(AVCodecParserContext *s, const uint8_t *buf,
|
||||
unsigned aspect_ratio;
|
||||
unsigned frame_rate_code;
|
||||
int low_delay;
|
||||
av_unused int ret;
|
||||
// update buf_size_min if parse more deeper
|
||||
const int buf_size_min = 15;
|
||||
|
||||
if (buf_size < buf_size_min)
|
||||
return;
|
||||
|
||||
init_get_bits8(&gb, buf, buf_size_min);
|
||||
ret = init_get_bits8(&gb, buf, buf_size_min);
|
||||
av_assert1(ret >= 0);
|
||||
|
||||
s->key_frame = 1;
|
||||
s->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
Loading…
Reference in New Issue
Block a user