|
@@ -184,15 +184,7 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
|
|
offset = 0;
|
|
offset = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- if (msblk->stream.avail_out == 0) {
|
|
|
|
- if (page == pages) {
|
|
|
|
- ERROR("zlib_inflate tried to "
|
|
|
|
- "decompress too much data, "
|
|
|
|
- "expected %d bytes. Zlib "
|
|
|
|
- "data probably corrupt\n",
|
|
|
|
- srclength);
|
|
|
|
- goto release_mutex;
|
|
|
|
- }
|
|
|
|
|
|
+ if (msblk->stream.avail_out == 0 && page < pages) {
|
|
msblk->stream.next_out = buffer[page++];
|
|
msblk->stream.next_out = buffer[page++];
|
|
msblk->stream.avail_out = PAGE_CACHE_SIZE;
|
|
msblk->stream.avail_out = PAGE_CACHE_SIZE;
|
|
}
|
|
}
|
|
@@ -209,25 +201,20 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
|
|
zlib_init = 1;
|
|
zlib_init = 1;
|
|
}
|
|
}
|
|
|
|
|
|
- zlib_err = zlib_inflate(&msblk->stream, Z_NO_FLUSH);
|
|
|
|
|
|
+ zlib_err = zlib_inflate(&msblk->stream, Z_SYNC_FLUSH);
|
|
|
|
|
|
if (msblk->stream.avail_in == 0 && k < b)
|
|
if (msblk->stream.avail_in == 0 && k < b)
|
|
put_bh(bh[k++]);
|
|
put_bh(bh[k++]);
|
|
} while (zlib_err == Z_OK);
|
|
} while (zlib_err == Z_OK);
|
|
|
|
|
|
if (zlib_err != Z_STREAM_END) {
|
|
if (zlib_err != Z_STREAM_END) {
|
|
- ERROR("zlib_inflate returned unexpected result"
|
|
|
|
- " 0x%x, srclength %d, avail_in %d,"
|
|
|
|
- " avail_out %d\n", zlib_err, srclength,
|
|
|
|
- msblk->stream.avail_in,
|
|
|
|
- msblk->stream.avail_out);
|
|
|
|
|
|
+ ERROR("zlib_inflate error, data probably corrupt\n");
|
|
goto release_mutex;
|
|
goto release_mutex;
|
|
}
|
|
}
|
|
|
|
|
|
zlib_err = zlib_inflateEnd(&msblk->stream);
|
|
zlib_err = zlib_inflateEnd(&msblk->stream);
|
|
if (zlib_err != Z_OK) {
|
|
if (zlib_err != Z_OK) {
|
|
- ERROR("zlib_inflateEnd returned unexpected result 0x%x,"
|
|
|
|
- " srclength %d\n", zlib_err, srclength);
|
|
|
|
|
|
+ ERROR("zlib_inflate error, data probably corrupt\n");
|
|
goto release_mutex;
|
|
goto release_mutex;
|
|
}
|
|
}
|
|
length = msblk->stream.total_out;
|
|
length = msblk->stream.total_out;
|