diff --git a/libtiff/tif_lzma.c b/libtiff/tif_lzma.c index b395de07..3f6096b6 100644 --- a/libtiff/tif_lzma.c +++ b/libtiff/tif_lzma.c @@ -247,6 +247,7 @@ LZMAPreEncode(TIFF* tif, uint16 s) { static const char module[] = "LZMAPreEncode"; LZMAState *sp = EncoderState(tif); + lzma_ret ret; (void) s; assert(sp != NULL); @@ -260,7 +261,13 @@ LZMAPreEncode(TIFF* tif, uint16 s) "Liblzma cannot deal with buffers this size"); return 0; } - return (lzma_stream_encoder(&sp->stream, sp->filters, sp->check) == LZMA_OK); + ret = lzma_stream_encoder(&sp->stream, sp->filters, sp->check); + if (ret != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error in lzma_stream_encoder(): %s", LZMAStrerror(ret)); + return 0; + } + return 1; } /*