From a8604d93566820bd9bc96c7ee7d5072e66261121 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Mon, 13 Feb 2023 17:07:12 -0600 Subject: LibVideo/VP9: Fallibly allocate the probability tables --- Userland/Libraries/LibVideo/VP9/Parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibVideo/VP9/Parser.cpp b/Userland/Libraries/LibVideo/VP9/Parser.cpp index 80c325d91e..4d2ef95e54 100644 --- a/Userland/Libraries/LibVideo/VP9/Parser.cpp +++ b/Userland/Libraries/LibVideo/VP9/Parser.cpp @@ -23,8 +23,7 @@ namespace Video::VP9 { #define TRY_READ(expression) DECODER_TRY(DecoderErrorCategory::Corrupted, expression) Parser::Parser(Decoder& decoder) - : m_probability_tables(make()) - , m_decoder(decoder) + : m_decoder(decoder) { } @@ -82,6 +81,8 @@ Vector Parser::parse_superframe_sizes(ReadonlyBytes frame_data) /* (6.1) */ DecoderErrorOr Parser::parse_frame(ReadonlyBytes frame_data) { + if (!m_probability_tables) + m_probability_tables = DECODER_TRY_ALLOC(try_make()); m_syntax_element_counter = make(); // NOTE: m_reusable_frame_block_contexts does not need to retain any data between frame decodes. -- cgit v1.2.3