1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

LibVideo/VP9: Ensure color space is not set to reserved value

This commit is contained in:
Tim Ledbetter 2023-10-11 17:57:56 +01:00 committed by Tim Flynn
parent 9a3e9047a5
commit 9788576936

View file

@ -330,6 +330,9 @@ DecoderErrorOr<ColorConfig> Parser::parse_color_config(BigEndianInputBitStream&
} }
auto color_space = static_cast<ColorSpace>(TRY_READ(bit_stream.read_bits(3))); auto color_space = static_cast<ColorSpace>(TRY_READ(bit_stream.read_bits(3)));
if (color_space == ColorSpace::Reserved)
return DecoderError::corrupted("color_config: Color space reserved value was set"sv);
VERIFY(color_space <= ColorSpace::RGB); VERIFY(color_space <= ColorSpace::RGB);
VideoFullRangeFlag video_full_range_flag; VideoFullRangeFlag video_full_range_flag;