LZMAPreEncode: emit verbose error if lzma_stream_encoder() fails (typically because not enough memory available)
This commit is contained in:
parent
d780c9db3f
commit
4429f75fab
@ -247,6 +247,7 @@ LZMAPreEncode(TIFF* tif, uint16 s)
|
|||||||
{
|
{
|
||||||
static const char module[] = "LZMAPreEncode";
|
static const char module[] = "LZMAPreEncode";
|
||||||
LZMAState *sp = EncoderState(tif);
|
LZMAState *sp = EncoderState(tif);
|
||||||
|
lzma_ret ret;
|
||||||
|
|
||||||
(void) s;
|
(void) s;
|
||||||
assert(sp != NULL);
|
assert(sp != NULL);
|
||||||
@ -260,7 +261,13 @@ LZMAPreEncode(TIFF* tif, uint16 s)
|
|||||||
"Liblzma cannot deal with buffers this size");
|
"Liblzma cannot deal with buffers this size");
|
||||||
return 0;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user