From fd3837c63bea5f1c1700f3b334944ed1522dd19d Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 10 Oct 2023 17:45:00 +0100 Subject: [PATCH] LibVideo/VP9: Return error for frames with invalid subsampling format Previously, the program would crash if this condition was encountered. We now return a decoder error allowing for graceful failure. --- Userland/Libraries/LibVideo/VP9/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibVideo/VP9/Parser.cpp b/Userland/Libraries/LibVideo/VP9/Parser.cpp index 5a4ab74b8f..ab3910c5d7 100644 --- a/Userland/Libraries/LibVideo/VP9/Parser.cpp +++ b/Userland/Libraries/LibVideo/VP9/Parser.cpp @@ -355,7 +355,7 @@ DecoderErrorOr Parser::parse_color_config(BigEndianInputBitStream& return DecoderError::corrupted("color_config: RGB reserved zero was set"sv); } else { // FIXME: Spec does not specify the subsampling value here. Is this an error or should we set a default? - VERIFY_NOT_REACHED(); + return DecoderError::corrupted("color_config: Invalid subsampling value for profile 0 or 2"sv); } }