From 5249664dd8178e985b4ef47af6e1772b4c7665e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Thu, 9 Jan 2014 19:06:31 +0100 Subject: prevent two further heap access violations pdf_open_raw_renumbered_stream and pdf_open_image_stream both have the same issue that 98a111c8e49916f8f5ac21d11f4627540f9ddd49 fixes. --- source/pdf/pdf-stream.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-stream.c b/source/pdf/pdf-stream.c index 0f568f16..e2b8c47e 100644 --- a/source/pdf/pdf-stream.c +++ b/source/pdf/pdf-stream.c @@ -365,10 +365,9 @@ pdf_open_raw_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num if (num < 0 || num >= pdf_xref_len(doc)) fz_throw(doc->ctx, FZ_ERROR_GENERIC, "object id out of range (%d %d R)", num, gen); - x = pdf_get_xref_entry(doc, num); - pdf_cache_object(doc, num, gen); + x = pdf_get_xref_entry(doc, num); if (x->stm_ofs == 0) fz_throw(doc->ctx, FZ_ERROR_GENERIC, "object is not a stream"); @@ -383,10 +382,9 @@ pdf_open_image_stream(pdf_document *doc, int num, int gen, int orig_num, int ori if (num < 0 || num >= pdf_xref_len(doc)) fz_throw(doc->ctx, FZ_ERROR_GENERIC, "object id out of range (%d %d R)", num, gen); - x = pdf_get_xref_entry(doc, num); - pdf_cache_object(doc, num, gen); + x = pdf_get_xref_entry(doc, num); if (x->stm_ofs == 0 && x->stm_buf == NULL) fz_throw(doc->ctx, FZ_ERROR_GENERIC, "object is not a stream"); -- cgit v1.2.3