View Issue Details

IDProjectCategoryView StatusLast Update
0006647JEDI Code LibraryJclCompressionpublic2019-04-17 07:22
ReporternojoyAssigned Tojfudickar 
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionVersion 2.5 (Subversion repository/Daily zips) 
Target VersionFixed in Version 
Summary0006647: Archive.CurrentItemIndex may return 0 in DoProgress when Archive.ItemCount is zero
DescriptionI do not exactly know under which circumstances, but sometimes (archive with many files?) TJclSevenzipUpdateArchive.OpenArchive triggers OpenCallback.DoProgress.

If this happens the function TJclSevenzipUpdateArchive.ListFiles fails (/can fail?) with an EListError, if the OnProgress-Callback contains the following code:

    if Archive.CurrentItemIndex >= 0 then
    begin
        Assert(Archive.ItemCount > 0); // this fails
        Item := Archive.Items[Archive.CurrentItemIndex]; //this gives an error
    end;

I expect CurrentItemIndex to be -1 if ItemCount is zero.


To fix this `FCurrentItemIndex := -1;` should be added to TJclCompressionArchive.ClearItems;
  
TagsNo tags attached.
Fixed in GIT commit
Fixed in SVN revision
IDE versionAll

Activities

mh

2019-04-13 10:02

reporter   ~0021661

I created a pull request containing your suggested initialization of the Field in the ClearItems method: https://github.com/project-jedi/jcl/pull/47

mh

2019-04-16 22:01

reporter   ~0021711

This pull request has been merged in, so this issue can be closed.

jfudickar

2019-04-17 07:22

developer   ~0021714

Fixed

Issue History

Date Modified Username Field Change
2018-08-13 15:56 nojoy New Issue
2018-08-13 15:56 nojoy IDE version => All
2019-04-13 10:02 mh Note Added: 0021661
2019-04-16 22:01 mh Note Added: 0021711
2019-04-17 07:22 jfudickar Note Added: 0021714
2019-04-17 07:22 jfudickar Status new => resolved
2019-04-17 07:22 jfudickar Resolution open => fixed
2019-04-17 07:22 jfudickar Assigned To => jfudickar