diff options
author | Simon Bünzli <zeniko@gmail.com> | 2014-10-28 14:51:34 +0100 |
---|---|---|
committer | Simon Bünzli <zeniko@gmail.com> | 2014-10-28 15:45:03 +0100 |
commit | b1542d7c2f33a4412606c013a5ba6ce0ad31c034 (patch) | |
tree | 9078fec12f117b289949f902bb03e4fd36b06be7 /source/pdf/pdf-stream.c | |
parent | 362d23df9f6151446419757d48a53ff33b67cf2f (diff) | |
download | mupdf-b1542d7c2f33a4412606c013a5ba6ce0ad31c034.tar.xz |
fix memory leaks in load_sample_func and pdf_load_compressed_inline_image
In load_sample_func, the stream is not closed and thus leaked if one of
the fz_read_byte or fz_read_bits calls throws (which might happen e.g.
on a Deflate data error).
In pdf_load_compressed_inline_image, the allocated buffer is not freed
if one of the stream initializers or the tile creation throws
(fz_open_leecher does not take ownership of the stream).
Diffstat (limited to 'source/pdf/pdf-stream.c')
-rw-r--r-- | source/pdf/pdf-stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/pdf/pdf-stream.c b/source/pdf/pdf-stream.c index 930c30cb..1b5cd79c 100644 --- a/source/pdf/pdf-stream.c +++ b/source/pdf/pdf-stream.c @@ -385,7 +385,7 @@ pdf_load_compressed_inline_image(pdf_document *doc, pdf_obj *dict, int length, f } fz_catch(ctx) { - fz_free(ctx, bc); + fz_free_compressed_buffer(ctx, bc); fz_rethrow(ctx); } image->buffer = bc; |