diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2012-06-28 10:47:49 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2012-06-28 10:47:49 +0300 |
commit | 1403707fc64a70976aebe66f8d9a9bd12f73a2c5 (patch) | |
tree | c86756ed5ffbad7da56f39c793e3f19b728a5b77 /src/liblzma/lzma | |
parent | Update NEWS from 5.0.4. (diff) | |
download | xz-1403707fc64a70976aebe66f8d9a9bd12f73a2c5.tar.xz |
liblzma: Check that the first byte of range encoded data is 0x00.
It is just to be more pedantic and thus perhaps catch broken
files slightly earlier.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/lzma/lzma_decoder.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c index d61b7dee..b6f1b6a1 100644 --- a/src/liblzma/lzma/lzma_decoder.c +++ b/src/liblzma/lzma/lzma_decoder.c @@ -289,8 +289,12 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr, // Initialization // //////////////////// - if (!rc_read_init(&coder->rc, in, in_pos, in_size)) - return LZMA_OK; + { + const lzma_ret ret = rc_read_init( + &coder->rc, in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + return ret; + } /////////////// // Variables // |