Sfoglia il codice sorgente

decrease restarts_to_go only if restart is enabled (solves runtime error if compiled with range checks)

Ondrej Pokorny 5 mesi fa
parent
commit
ec5b4d458e
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      packages/pasjpeg/src/jdhuff.pas

+ 2 - 1
packages/pasjpeg/src/jdhuff.pas

@@ -1240,7 +1240,8 @@ begin
   end;
 
   { Account for restart interval (no-op if not using restarts) }
-  Dec(entropy^.restarts_to_go);
+  if (cinfo^.restart_interval <> 0) then
+    Dec(entropy^.restarts_to_go);
 
   decode_mcu := TRUE;
 end;