Bug 688712

Summary: Some broken jpeg are considered as valid by libjpeg-turbo
Product: [Fedora] Fedora Reporter: Christophe GRENIER <grenier>
Component: libjpeg-turboAssignee: Adam Tkac <atkac>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 14CC: atkac, grenier, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libjpeg-turbo-1.1.0-2.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-29 04:00:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Broken jpeg considered as valid by libjpeg-turbo
none
Little C program to check the jpeg file validity none

Description Christophe GRENIER 2011-03-17 19:25:32 UTC
Created attachment 486087 [details]
Broken jpeg considered as valid by libjpeg-turbo

Description of problem:
Some broken jpeg are considered as valid by libjpeg-turbo. The bug has been introduced when libjpeg has been replaced by libjpeg-turbo (Fedora 14 release).
Some software relies on error detection like the forensics tool photorec (testdisk package).

Version-Release number of selected component (if applicable):
libjpeg-turbo-1.0.1-1.fc14.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. gcc -W -Wall -o check_jpg check_jpg.c -ljpeg
2. ./check_jpeg broken.jpg
  
Actual results:
Start of Image
Miscellaneous marker 0xe1, length 7164
Define Quantization Table 0  precision 0
Define Quantization Table 1  precision 0
Start Of Frame 0xc0: width=2272, height=1704, components=3
    Component 1: 2hx1v q=0
    Component 2: 1hx1v q=1
    Component 3: 1hx1v q=1
Define Huffman Table 0x00
Define Huffman Table 0x10
Define Huffman Table 0x01
Define Huffman Table 0x11
Start Of Scan: 3 components
    Component 1: dc=0 ac=0
    Component 2: dc=1 ac=1
    Component 3: dc=1 ac=1
  Ss=0, Se=63, Ah=0, Al=0
End Of Image
broken.jpg OK

Expected results:
Start of Image
Miscellaneous marker 0xe1, length 7164
Define Quantization Table 0  precision 0
Define Quantization Table 1  precision 0
Start Of Frame 0xc0: width=2272, height=1704, components=3
    Component 1: 2hx1v q=0
    Component 2: 1hx1v q=1
    Component 3: 1hx1v q=1
Define Huffman Table 0x00
Define Huffman Table 0x10
Define Huffman Table 0x01
Define Huffman Table 0x11
Start Of Scan: 3 components
    Component 1: dc=0 ac=0
    Component 2: dc=1 ac=1
    Component 3: dc=1 ac=1
  Ss=0, Se=63, Ah=0, Al=0
Corrupt JPEG data: premature end of data segment
End Of Image
broken.jpg BAD

"display broken.jpg" (ImageMagick package) only show an error
"display: Corrupt JPEG data: premature end of data segment `broken.jpg' @ warning/jpeg.c/EmitMessage/230." when used with libjpeg instead of libjpeg-turbo

Additional info:
I have used /usr/lib64/libjpeg.so.62.0.0 from CentOS 5.5 libjpeg to generate the expected results.

Comment 1 Christophe GRENIER 2011-03-17 19:26:40 UTC
Created attachment 486088 [details]
Little C program to check the jpeg file validity

Comment 2 Christophe GRENIER 2011-03-17 19:34:41 UTC
Problem has been reproduced with libjpeg-turbo-1.1.0

Bug has been opened upstream
https://sourceforge.net/tracker/?func=detail&aid=3220774&group_id=303195&atid=1278158

Comment 3 Fedora Update System 2011-03-22 14:16:57 UTC
libjpeg-turbo-1.1.0-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/libjpeg-turbo-1.1.0-2.fc14

Comment 4 Fedora Update System 2011-03-22 14:17:04 UTC
libjpeg-turbo-1.1.0-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/libjpeg-turbo-1.1.0-2.fc15

Comment 5 Fedora Update System 2011-03-29 04:00:18 UTC
libjpeg-turbo-1.1.0-2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2011-04-02 22:48:17 UTC
libjpeg-turbo-1.1.0-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.