You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
h264: check ref_count validity for num_ref_idx_active_override_flag
Fixes segfault in the fuzzed sample bipbop234.ts_s226407. CC: libav-stable@libav.org
This commit is contained in:
@@ -2841,8 +2841,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
|
|
||||||
if (num_ref_idx_active_override_flag) {
|
if (num_ref_idx_active_override_flag) {
|
||||||
h->ref_count[0] = get_ue_golomb(&s->gb) + 1;
|
h->ref_count[0] = get_ue_golomb(&s->gb) + 1;
|
||||||
if (h->slice_type_nos == AV_PICTURE_TYPE_B)
|
if (h->ref_count[0] < 1)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
|
||||||
h->ref_count[1] = get_ue_golomb(&s->gb) + 1;
|
h->ref_count[1] = get_ue_golomb(&s->gb) + 1;
|
||||||
|
if (h->ref_count[1] < 1)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (h->slice_type_nos == AV_PICTURE_TYPE_B)
|
if (h->slice_type_nos == AV_PICTURE_TYPE_B)
|
||||||
|
Reference in New Issue
Block a user