Closed rhaist closed 9 years ago
I probably should, but I wonder if its a problem with my logic somewhere else. I can't see any similar checks in the unrar source. The ppm stuff in unrar was the least understandable for me.
I have tried to reproduce the problem with corrupt files, but no luck so far. I added a couple more checks in, but if that doesn't fix it, ill add that check in.
Problem has been taken care of in the latest commits.
On some really corrupt rar files I get an "integer divide by zero" error in decodeSymbol1() probably caused in the call to currentCount()
You maybe want to include a check to ensure scale and r.rnge are not null and throw an errCorruptPPM otherwise.
https://github.com/nwaples/rardecode/blob/master/ppm_model.go#L321