ソースを参照

LibGfx/JBIG2: Tweak decode_immediate_generic_region()

Set context only for non-MMR.

No behavior change.
Nico Weber 1 年間 前
コミット
825b4d4e94
1 ファイル変更3 行追加1 行削除
  1. 3 1
      Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp

+ 3 - 1
Userland/Libraries/LibGfx/ImageFormats/JBIG2Loader.cpp

@@ -2096,9 +2096,11 @@ static ErrorOr<void> decode_immediate_generic_region(JBIG2LoadingContext& contex
     // 7.4.6.4 Decoding a generic region segment
     // "1) Interpret its header, as described in 7.4.6.1"
     // Done above.
+
     // "2) As described in E.3.7, reset all the arithmetic coding statistics to zero."
     Vector<JBIG2::ArithmeticDecoder::Context> contexts;
-    contexts.resize(1 << number_of_context_bits_for_template(arithmetic_coding_template));
+    if (!uses_mmr)
+        contexts.resize(1 << number_of_context_bits_for_template(arithmetic_coding_template));
 
     // "3) Invoke the generic region decoding procedure described in 6.2, with the parameters to the generic region decoding procedure set as shown in Table 37."
     GenericRegionDecodingInputParameters inputs;