Bug 20484 - Invalid usage of jpeglib in DCTScream.cc
Summary: Invalid usage of jpeglib in DCTScream.cc
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-05 04:21 UTC by Ryszard Trojnacki
Modified: 2009-03-08 04:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ryszard Trojnacki 2009-03-05 04:21:08 UTC
In file DCTStream.cc:75 at method init() field cinfo.err is initialized after call to jpeg_create_decompress(&cinfo) and this makes a segmentation fault when an error thrown while calling this function (jpeg_create_decompress).

The correct usage should be like this:
void DCTStream::init()
{
  jpeg_std_error(&jerr);
  jerr.error_exit = &exitErrorHandler;
  cinfo.err = &jerr;
  src.pub.init_source = str_init_source;
  src.pub.fill_input_buffer = str_fill_input_buffer;
  src.pub.skip_input_data = str_skip_input_data;
  src.pub.resync_to_restart = jpeg_resync_to_restart;
  src.pub.term_source = str_term_source;
  src.pub.bytes_in_buffer = 0;
  src.pub.next_input_byte = NULL;
  src.str = str;
  src.index = 0;
  src.abort = false;
  cinfo.src = (jpeg_source_mgr *)&src;

  jpeg_create_decompress(&cinfo);
  x = 0;
  row_buffer = NULL;
}
Comment 1 Albert Astals Cid 2009-03-08 04:43:16 UTC
Fixed, thanks for reporting.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.