Browse Source

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.
Tim Ledbetter 1 year ago
parent
commit
fd3837c63b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibVideo/VP9/Parser.cpp

+ 1 - 1
Userland/Libraries/LibVideo/VP9/Parser.cpp

@@ -355,7 +355,7 @@ DecoderErrorOr<ColorConfig> Parser::parse_color_config(BigEndianInputBitStream&
                 return DecoderError::corrupted("color_config: RGB reserved zero was set"sv);
                 return DecoderError::corrupted("color_config: RGB reserved zero was set"sv);
         } else {
         } else {
             // FIXME: Spec does not specify the subsampling value here. Is this an error or should we set a default?
             // 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);
         }
         }
     }
     }