Anyway, it crashes on the line with
Code:
(void) jpeg_finish_decompress(&data.d_info);
Any idea why this happens?
Code:
JPEG_DATA data;
data.quality=95;
data.source_type=st;
data.target_type=tt;
data.source_color_space=scs;
data.target_color_space=tcs;
prepare_read_jpg_file(argv[2], &data);
read_jpg_file(&data);
(void) jpeg_finish_decompress(&data.d_info);
jpeg_destroy_decompress(&data.d_info);
prepare_write_jpg_file(argv[3], &data);
// write_jpg_file(&data);
jpeg_finish_compress(&data.c_info);
jpeg_destroy_compress(&data.c_info);
They normally use style like this:
Code:
(void) jpeg_finish_decompress(&cinfo);
but when I pass &data.d_info it crashes.
I also tested to move the fclose after the clean rutines:
Code:
(void) jpeg_finish_decompress(&data.d_info);
jpeg_destroy_decompress(&data.d_info);
fclose(data.fpr);
But still crashes