DescriptionEmergency goobsdiff patch: don't use LZMA_RUN after LZMA_FINISH.
In testing, cases were discovered where fread would read until EOF, but
lzma_code would not be able to decompress that entire block in one call
because not enough space was available in the output buffer. Calling lzma_code
with LZMA_FINISH followed by LZMA_RUN is incorrect. Once LZMA_FINISH is used
once, subsequent calls to lzma_code must also use LZMA_FINISH.
From <lzma/base.h>:
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH,
* the same `action' must is used until lzma_code() returns LZMA_STREAM_END.
* Also, the amount of input (that is, strm->avail_in) must not be modified
* by the application until lzma_code() returns LZMA_STREAM_END. Changing the
* `action' or modifying the amount of input will make lzma_code() return
* LZMA_PROG_ERROR.
This bug caused goobspatch to exit prematurely with a message like
goobspatch: xzread(extra, 216): 11
11 is LZMA_PROG_ERROR.
BUG=47199
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=50537
Patch Set 1 #
Messages
Total messages: 2 (0 generated)
|