mirror of
https://github.com/wader/fq.git
synced 2024-12-25 14:23:18 +03:00
hevc_vps,fuzz: Error on too many vps layers
This commit is contained in:
parent
e50a225f9d
commit
fd302093e1
@ -16,6 +16,8 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const maxVpsLayers = 1000
|
||||||
|
|
||||||
// H.265 page 33
|
// H.265 page 33
|
||||||
func hevcVPSDecode(d *decode.D, _ any) any {
|
func hevcVPSDecode(d *decode.D, _ any) any {
|
||||||
d.FieldU4("vps_video_parameter_set_id")
|
d.FieldU4("vps_video_parameter_set_id")
|
||||||
@ -42,6 +44,9 @@ func hevcVPSDecode(d *decode.D, _ any) any {
|
|||||||
})
|
})
|
||||||
vpsMaxLayerID := d.FieldU6("vps_max_layer_id")
|
vpsMaxLayerID := d.FieldU6("vps_max_layer_id")
|
||||||
vpsNumLayerSetsMinus1 := d.FieldUFn("vps_num_layer_sets_minus1", uEV)
|
vpsNumLayerSetsMinus1 := d.FieldUFn("vps_num_layer_sets_minus1", uEV)
|
||||||
|
if vpsNumLayerSetsMinus1 > maxVpsLayers {
|
||||||
|
d.Errorf("too many vps layers %d > %d", vpsNumLayerSetsMinus1, maxVpsLayers)
|
||||||
|
}
|
||||||
d.FieldArray("layer_id_included_sets_flags", func(d *decode.D) {
|
d.FieldArray("layer_id_included_sets_flags", func(d *decode.D) {
|
||||||
for i := uint64(0); i <= vpsNumLayerSetsMinus1; i++ {
|
for i := uint64(0); i <= vpsNumLayerSetsMinus1; i++ {
|
||||||
d.FieldArray("layer_id_included_sets_flags", func(d *decode.D) {
|
d.FieldArray("layer_id_included_sets_flags", func(d *decode.D) {
|
||||||
|
Loading…
Reference in New Issue
Block a user