if (tzh_timecnt < 0) or (tzh_timecnt > fs) then raise exception.create('tzh_timecnt');\r
ofs2 := ofs;\r
\r
- for a := 0 to tzh_timecnt -1 do begin\r
- if mode64 then t := getint64 else t := getint;\r
- if (t > ts) then begin\r
- index := a - 1;\r
- break;\r
+ if (tzh_timecnt <> 0) then begin\r
+ for a := 0 to tzh_timecnt -1 do begin\r
+ if mode64 then t := getint64 else t := getint;\r
+ if (t > ts) then begin\r
+ index := a - 1;\r
+ break;\r
+ end;\r
+ if (a = tzh_timecnt -1) and (ts >= t) then index := a;\r
end;\r
- if (a = tzh_timecnt -1) and (ts >= t) then index := a;\r
- end;\r
- ofs := ofs2 + tzh_timecnt * (1 + ord(mode64)) * 4;\r
+ ofs := ofs2 + tzh_timecnt * (1 + ord(mode64)) * 4;\r
\r
- if (cardinal(ofs + index) >= fs) or (index < 0) then raise exception.create('index');\r
- index := buf[ofs+index];\r
- inc(ofs,tzh_timecnt);\r
+ if (cardinal(ofs + index) >= fs) or (index < 0) then raise exception.create('index');\r
+ index := buf[ofs+index];\r
+ inc(ofs,tzh_timecnt);\r
+ end else begin\r
+ index := 0;\r
+ end;\r
\r
if (index >= tzh_typecnt) then raise exception.create('type');\r
ofs2 := ofs;\r