Why this app has internal copies of these files instead of just making use of the same routines which are also provided by libjpeg-turbo is for others to answer.
Running eog in gdb looking at _save_jpeg_as_jpeg in the eog code
jpeg_stdio_src (&srcinfo, input_file);
/* Enable saving of extra markers that we want to copy */
jcopy_markers_setup (&srcinfo, JCOPYOPT_DEFAULT);
/* Any space needed by a transform option must be requested before
* jpeg_read_coefficients so that memory allocation will be done right.
*/
jtransform_request_workspace (&srcinfo, &transformoption);
/* Adjust destination parameters if required by transform options;
* also find out which set of coefficient arrays will hold the output.
*/
--- FINE
dst_coef_arrays = jtransform_adjust_parameters (&srcinfo,
&dstinfo, src_coef_arrays, &transformoption);
--- NOT FINE
/* Specify data destination for compression */
jpeg_stdio_dest (&dstinfo, output_file);
/* Start compressor (note no image data is actually written here) */
jpeg_write_coefficients (&dstinfo, dst_coef_arrays);
by jpeg_stdio_dest, in dstinfo the jpeg_width and jpeg_height portions of the structure have garbage in them. And just after the jpeg_copy_critical_parameters those fields are fine.
debug continues. Theory at this point, the old and copied jtransform_adjust_parameters might contain the bug.
Ok so looking into this. When the app crashed, is not from libjpeg-turbo8 instead it's from http:// bazaar. launchpad. net/~vcs- imports/ eog/trunk/ view/head: /jpegutils/ transupp- 8a.c which is a file that was copied some years back from the libjpeg project.
Why this app has internal copies of these files instead of just making use of the same routines which are also provided by libjpeg-turbo is for others to answer.
Running eog in gdb looking at _save_jpeg_as_jpeg in the eog code
jpeg_stdio_src (&srcinfo, input_file);
/* Enable saving of extra markers that we want to copy */ markers_ setup (&srcinfo, JCOPYOPT_DEFAULT);
jcopy_
/* Read file header */
(void) jpeg_read_header (&srcinfo, TRUE);
/* Any space needed by a transform option must be requested before coefficients so that memory allocation will be done right. request_ workspace (&srcinfo, &transformoption);
* jpeg_read_
*/
jtransform_
/* Read source file as DCT coefficients */ coefficients (&srcinfo);
src_coef_arrays = jpeg_read_
/* Initialize destination compression parameters from source values */ critical_ parameters (&srcinfo, &dstinfo);
jpeg_copy_
/* Adjust destination parameters if required by transform options;
* also find out which set of coefficient arrays will hold the output.
*/
--- FINE adjust_ parameters (&srcinfo,
src_coef_ arrays,
&transformoptio n);
dst_coef_arrays = jtransform_
&dstinfo,
--- NOT FINE
/* Specify data destination for compression */
jpeg_stdio_dest (&dstinfo, output_file);
/* Start compressor (note no image data is actually written here) */ coefficients (&dstinfo, dst_coef_arrays);
jpeg_write_
by jpeg_stdio_dest, in dstinfo the jpeg_width and jpeg_height portions of the structure have garbage in them. And just after the jpeg_copy_ critical_ parameters those fields are fine.
debug continues. Theory at this point, the old and copied jtransform_ adjust_ parameters might contain the bug.