浏览代码

LibPDF: In Type0::initialize(), move variable increment next to cause

No behavior change.
Nico Weber 1 年之前
父节点
当前提交
ef5d7b685d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Userland/Libraries/LibPDF/Fonts/Type0Font.cpp

+ 2 - 2
Userland/Libraries/LibPDF/Fonts/Type0Font.cpp

@@ -293,10 +293,10 @@ PDFErrorOr<void> Type0Font::initialize(Document* document, NonnullRefPtr<DictObj
                 auto first_code = pending_code.release_value();
                 auto first_code = pending_code.release_value();
                 auto last_code = value.to_int();
                 auto last_code = value.to_int();
                 auto width = widths_array->at(i + 1).to_int();
                 auto width = widths_array->at(i + 1).to_int();
+                i++;
+
                 for (u16 code = first_code; code <= last_code; code++)
                 for (u16 code = first_code; code <= last_code; code++)
                     widths.set(code, width);
                     widths.set(code, width);
-
-                i++;
             } else {
             } else {
                 auto array = TRY(document->resolve_to<ArrayObject>(value));
                 auto array = TRY(document->resolve_to<ArrayObject>(value));
                 auto code = pending_code.release_value();
                 auto code = pending_code.release_value();