diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2018-08-22 20:38:58 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2018-08-22 20:48:25 +0800 |
commit | a43bac812d152761b03c1e080d452e7595e78754 (patch) | |
tree | 0fc9b8622be03825e6f0d1140e143ec1a17d520b /source | |
parent | a1feb3abb2821a0f8e00d146e6426ecdb9922b94 (diff) | |
download | mupdf-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.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-appearance.c | 3 |
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)); |