소스 검색

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

Ondrej Pokorny 5 달 전
부모
커밋
ec5b4d458e
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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;