summaryrefslogtreecommitdiff
path: root/src/lib/lzma.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/lzma.c')
-rw-r--r--src/lib/lzma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/lzma.c b/src/lib/lzma.c
index b46ddfcdae..dbaa805afa 100644
--- a/src/lib/lzma.c
+++ b/src/lib/lzma.c
@@ -28,16 +28,19 @@ static unsigned long ulzma(unsigned char * src, unsigned char * dst)
outSize = *(UInt32 *)(src + LZMA_PROPERTIES_SIZE);
if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK) {
printk_warning("Incorrect stream properties\n");
+ return 0;
}
mallocneeds = (LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
if (mallocneeds > 15980) {
printk_warning("Decoder scratchpad too small!\n");
+ return 0;
}
state.Probs = (CProb *)scratchpad;
res = LzmaDecode(&state, src + LZMA_PROPERTIES_SIZE + 8, (SizeT)0xffffffff, &inProcessed,
dst, outSize, &outProcessed);
if (res != 0) {
printk_warning("Decoding error = %d\n", res);
+ return 0;
}
return outSize;
}