jvns/gzip.jl — pull request #2 by bmaurer (2013-12-25 21:45:58+00:00)
Title: Fix crash

I'm not enough of an expert on the gzip format to understand why this caused a crash, this code seems to have fixed it. I followed http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art001

// This is a back-pointer to a position in the stream
// Interpret the length here as specified in 3.2.5
if ( node->code < 265 )
{
length = node->code - 254;
}
else
{
if ( node->code < 285 )
{
extra_bits = read_bits_inv( stream, ( node->code - 261 ) / 4 );
length = extra_bits + extra_length_addend[ node->code - 265 ];
}
else
{
length = 258;
}
}