avcodec/vorbisdec: validate windowtype and transformtype

This commit is contained in:
Hassan Hany
2026-04-16 10:24:41 +00:00
committed by michaelni
co-authored by michaelni
parent 5abc240a27
commit 3b19a61837
+7 -2
View File
@@ -908,8 +908,13 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
vorbis_mode *mode_setup = &vc->modes[i];
mode_setup->blockflag = get_bits1(gb);
mode_setup->windowtype = get_bits(gb, 16); //FIXME check
mode_setup->transformtype = get_bits(gb, 16); //FIXME check
mode_setup->windowtype = get_bits(gb, 16);
mode_setup->transformtype = get_bits(gb, 16);
if (mode_setup->transformtype != 0 || mode_setup->windowtype != 0) {
av_log(vc->avctx, AV_LOG_WARNING,
"Invalid mode: windowtype %u, transformtype %u (both must be 0)\n",
mode_setup->windowtype, mode_setup->transformtype);
}
GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count);
ff_dlog(NULL, " %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",