Closed Bug 1300661 Opened 8 years ago Closed 8 years ago

PNG image is said to be corrupted

Categories

(Core :: Graphics: ImageLib, defect)

48 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1311776
Tracking Status
firefox48 --- affected
firefox50 --- affected
firefox51 --- affected

People

(Reporter: karlcow, Assigned: glennrp+bmo)

References

Details

(Whiteboard: [webcompat], gfx-noted)

Attachments

(1 file)

This is a spin off of the Web Compat issue https://webcompat.com/issues/3148

Steps to reproduce 

1. Go to https://potplayer.daum.net/forum/ucp.php?mode=register
2. Click on the agreement button
3. Redirection to a new page with a form
4. At the bottom of the form there is a section for an image which is not displayed.

HTML code

<li class="list-group-item">
   <img src="./ucp.php?mode=confirm&amp;confirm_id=217d9c9f1a2429ff0b03ddc0972c1dfb&amp;type=1" alt="Confirmation code" style="display: block; margin: auto;">
</li>


The URI https://potplayer.daum.net/forum/ucp.php?mode=confirm&confirm_id=217d9c9f1a2429ff0b03ddc0972c1dfb&type=1
is sending the same response header to Firefox and Safari

```http
HTTP/1.1 200 OK
Cache-control: no-cache, no-store
Connection: Keep-Alive
Content-Type: image/png
Date: Tue, 06 Sep 2016 02:10:20 GMT
Keep-Alive: timeout=5, max=100
Server:
Set-Cookie: phpbb3_cg7xa_u=1; expires=Wed, 06-Sep-2017 02:10:20 GMT; path=/; domain=potplayer.daum.net; HttpOnly
Set-Cookie: phpbb3_cg7xa_k=; expires=Wed, 06-Sep-2017 02:10:20 GMT; path=/; domain=potplayer.daum.net; HttpOnly
Set-Cookie: phpbb3_cg7xa_sid=3ecf68c66c91e98611b1521a123f93ac; expires=Wed, 06-Sep-2017 02:10:20 GMT; path=/; domain=potplayer.daum.net; HttpOnly
Transfer-Encoding: chunked
X-Powered-By: PHP/5.5.13
```

The message in the console in Firefox is

```
Image corrupt or truncated.
```

from https://dxr.mozilla.org/mozilla-central/source/image/RasterImage.cpp#1666


The image displays well in Safari/WebKit and Opera/Blink.

Saving the image from Safari locally and trying to open with Firefox leads to the same error.

Same issue in Firefox 48, 50 and 51
Maybe something for Seth
Flags: needinfo?(seth.bugzilla)
Whiteboard: [webcompat]
Flags: needinfo?(aosmond)
pngcheck says "zlib: inflate error = -3 (data error)"

I know in the past we've encountered png's where the crc didn't match in the deflate data, we refuse to display these pngs. But I guess other browsers don't.
Whiteboard: [webcompat] → [webcompat], gfx-noted
Changing the png_error() to a png_benign_error() at line 844 in pngpread.c fixes this bug.  I'll post a patch shortly to do this safely.
Assignee: nobody → glennrp+bmo
Status: NEW → ASSIGNED
Flags: needinfo?(seth.bugzilla)
I've pushed the patch upstream to the libpng GIT repositories, for eventual release in libpng-1.6.26
Flags: needinfo?(aosmond)
Confirmed that this is fixed by the introduction of libpng 1.6.26.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Blocks: 1326234
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: