avcodec/dovi_rpudec: bound num_x/y_partitions

Fixes: out of array access
Fixes: SUcVEyk7r3Gc
Found-by: Kenan Alghythee <kalghy2@uic.edu>
(cherry picked from commit 79e10e5196)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-07-11 17:01:30 +02:00
parent 5d82a3c369
commit ad25ca73b5

View File

@@ -582,6 +582,8 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
mapping->num_x_partitions = get_ue_golomb_long(gb) + 1;
mapping->num_y_partitions = get_ue_golomb_long(gb) + 1;
VALIDATE(mapping->num_x_partitions, 1, 0xFFFF);
VALIDATE(mapping->num_y_partitions, 1, 0xFFFF);
/* End of rpu_data_header(), start of vdr_rpu_data_payload() */
for (int c = 0; c < 3; c++) {