Skip to content

Commit

Permalink
Added bugfix from unknown user at sourceforge, thanks whoever you are!
Browse files Browse the repository at this point in the history
  • Loading branch information
orrche committed Sep 18, 2010
1 parent 3fe5ff2 commit c87e5cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rarfs/src/rararchive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ RARArchive::Parse(bool showcompressed)

char buf[4];
file->read(buf,3);
//for some rar files there are seeks past file end, then directly to file end
//which makes file->good() return true, but there is nothing to read
//so with file->gcount() we check if we actually read something
//otherwise we use old bufer and crash somewhere
if(file->gcount()==0)
break;

file->seekg (-3, std::ios::cur);

switch( buf[2] )
Expand Down

0 comments on commit c87e5cc

Please sign in to comment.