X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=lib%2Fdecompress_unlzma.c;h=ca82fde81c8fc48a39a22495fbe9d489142d04aa;hb=fd25a1f556760dbd6e29dec66c70223a8912cdb2;hp=0b954e04bd3015bb08332b2a30a13e1ff6414fea;hpb=a1cb9cd69750d6d62251393738efc02d252b67d3;p=karo-tx-linux.git diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c index 0b954e04bd30..ca82fde81c8f 100644 --- a/lib/decompress_unlzma.c +++ b/lib/decompress_unlzma.c @@ -82,6 +82,11 @@ struct rc { #define RC_MODEL_TOTAL_BITS 11 +static int nofill(void *buffer, unsigned int len) +{ + return -1; +} + /* Called twice: once at startup and once in rc_normalize() */ static void INIT rc_read(struct rc *rc) { @@ -97,7 +102,10 @@ static inline void INIT rc_init(struct rc *rc, int (*fill)(void*, unsigned int), char *buffer, int buffer_size) { - rc->fill = fill; + if (fill) + rc->fill = fill; + else + rc->fill = nofill; rc->buffer = (uint8_t *)buffer; rc->buffer_size = buffer_size; rc->buffer_end = rc->buffer + rc->buffer_size;