From 36c37347f53a8c6885833fcc0115262d6d1bc986 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 7 Jan 2011 11:41:24 +0900 Subject: [PATCH] Init setjmp buffer before calling jpeg_create_decompress() in DCTStream::init(). --- poppler/DCTStream.cc | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc index 212a8bd..04bec5a 100644 --- a/poppler/DCTStream.cc +++ b/poppler/DCTStream.cc @@ -91,8 +91,13 @@ void DCTStream::init() limit = NULL; cinfo.err = &jerr; - jpeg_create_decompress(&cinfo); + // exitErrorHandler() refers to cinfo.src.setjmp_buffer cinfo.src = (jpeg_source_mgr *)&src; + if (!setjmp(src.setjmp_buffer)) { + jpeg_create_decompress(&cinfo); + // jpeg_create_decompress() touches cinfo.src set above + cinfo.src = (jpeg_source_mgr *)&src; + } row_buffer = NULL; } -- 1.7.2.3