How to call libjpeg API in an erroneous way?

88 Views Asked by At

I want to test my error handling code when using the libjpeg but I cannot find a suitable call which to produce an error. If I simply pass a nullptr to some of the calls expecting a pointer to a structure then the library just crashes. I want to find a statement that calls the set in the jpeg_error_mgr's error_exit function.

1

There are 1 best solutions below

0
On BEST ANSWER

I managed to produce an error when calling libjpeg's functions on jpeg_compress_struct or jpeg_decompress_struct without first calling the jpeg_create_compress or jpeg_create_decompress functions respectively.