summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2018-08-22 20:38:58 +0800
committerSebastian Rasmussen <sebras@gmail.com>2018-08-22 20:48:25 +0800
commita43bac812d152761b03c1e080d452e7595e78754 (patch)
tree0fc9b8622be03825e6f0d1140e143ec1a17d520b
parenta1feb3abb2821a0f8e00d146e6426ecdb9922b94 (diff)
downloadmupdf-a43bac812d152761b03c1e080d452e7595e78754.tar.xz
Plug leak of buffer when button widgets are ignored.
The leak was triggered by the PDF from 699576, but this commit does not fully fix that bug.
-rw-r--r--source/pdf/pdf-appearance.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c
index b19294bd..ceadfd09 100644
--- a/source/pdf/pdf-appearance.c
+++ b/source/pdf/pdf-appearance.c
@@ -1320,7 +1320,7 @@ void pdf_update_appearance(fz_context *ctx, pdf_annot *annot)
{
fz_rect rect, bbox;
fz_matrix matrix = fz_identity;
- fz_buffer *buf = fz_new_buffer(ctx, 1024);
+ fz_buffer *buf;
pdf_obj *res = NULL;
pdf_obj *new_ap_n = NULL;
fz_var(res);
@@ -1333,6 +1333,7 @@ void pdf_update_appearance(fz_context *ctx, pdf_annot *annot)
if (pdf_name_eq(ctx, pdf_dict_get_inheritable(ctx, annot->obj, PDF_NAME(FT)), PDF_NAME(Btn)))
return;
+ buf = fz_new_buffer(ctx, 1024);
fz_try(ctx)
{
rect = pdf_dict_get_rect(ctx, annot->obj, PDF_NAME(Rect));