Bug Description:
When executing djpeg (newest release version) , the program terminates with Nonfatal Error shown below.
Corrupt JPEG data: 2 extraneous bytes before marker 0xc1
P6
227 9
255
Then I apply MSan (Memory Sanitizer ) to check for memory errors and the error report is as follows.
==83120==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x4bd5e0 in h2v2_merged_upsample /jpeg-9c/jdmerge.c:380:26
#1 0x4bca17 in merged_2v_upsample /jpeg-9c/jdmerge.c:228:5
#2 0x4f0e26 in process_data_simple_main /jpeg-9c/jdmainct.c:366:3
#3 0x4a3b7f in jpeg_read_scanlines /jpeg-9c/jdapistd.c:174:3
#4 0x4947a1 in main /jpeg-9c/djpeg.c:589:21
#5 0x7fba0e279c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#6 0x41b599 in _start (/djpeg/djpeg_msan+0x41b599)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /jpeg-9c/jdmerge.c:380:26 in h2v2_merged_upsample
Step to Reproduce
download the libjpeg from github and build it with MSAN
Execute djpeg with given testcases
Anonymous
Please could you double check the file you've attached? It looks like a tiff file?