The default bug view has changed. See this FAQ.

Update libpng to version 1.5.10

RESOLVED FIXED in mozilla15

Status

()

Core
ImageLib
--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Glenn Randers-Pehrson, Assigned: Glenn Randers-Pehrson)

Tracking

Trunk
mozilla15
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 5 obsolete attachments)

(Assignee)

Description

5 years ago
Created attachment 614760 [details] [diff] [review]
v00 update bundled libpng to version 1.5.10

Libpng-1.5.10 has been out for a couple of weeks and seems to be stable.  The main reason for the release was to fix CVE-2011-3048, but we aren't vulnerable to that.  It also ignores multiple iCCP chunks which could give us a slight performance benefit.
(Assignee)

Updated

5 years ago
Assignee: nobody → glennrp+bmo
(Assignee)

Comment 1

5 years ago
A new feature of libpng-1.5.10 is to check for invalid palette index and iissue a warning if one is found.  Previously we allowed invalid indexes and rendered any pixels with such an invalid index to black.  The v00 patch does not enable this feature, for speed consideration (otherwise an extra pass is made over each row), so we continue to render any such pixels as black without a warning.  This is harmless.
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Depends on: 648690
I'll update the apng diff and give it a Try push tonight.
(Assignee)

Comment 3

5 years ago
Created attachment 614769 [details] [diff] [review]
v01: Update libpng to version 1.5.10

Added checkin header, updated MOZCHANGES
Attachment #614760 - Attachment is obsolete: true

Comment 4

5 years ago
Ryan, I found a typo that probably existed for years...

In png_get_next_frame_fcTL() we are testing the pointer to x_offset twice, but no y_offset
(Assignee)

Comment 5

5 years ago
See also bug#745202 which disables the unnecessary palette-index testing when using the systems libpng, when PR_LOGGING is disabled.  @Max, I'll post a v02 patch fixing the typo, thanks.
(Assignee)

Comment 6

5 years ago
Created attachment 614797 [details] [diff] [review]
v02 update bundled libpng to version 1.5.10
Attachment #614769 - Attachment is obsolete: true
I had to fix up an ifdef in png.h, but other than that, it passes on try.
https://tbpl.mozilla.org/?tree=Try&rev=82bbfa4bd308

Also, there's a new build warning in pngpread.c. Here's the MSVC version:
pngpread.c(690) : warning C4013: 'MOZ_PNG_handle_unknown' undefined; assuming extern returning int
Glenn, how should we proceed on the new warning?
(Assignee)

Comment 9

5 years ago
It's an error in libpng.

At line 361 in pngpread.c (APNG patched) or line 258 (unpatched)
I think we need the following instead of the two lines that are there
(splitting the "else if" into two parts):

#ifdef PNG_HANDLE_UNKNOWN_SUPPORTED
   else
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
   if (png_chunk_unknown_handling(png_ptr, chunk_name))
#endif
(Assignee)

Comment 10

5 years ago
Also the "else { .. } " block beginning around line 680 needs to be
enclosed in #ifdef PNG_HANDLE_UNKNOWN_SUPPORTED / #endif

I'm preparing a new patch.
(Assignee)

Comment 11

5 years ago
Created attachment 617715 [details] [diff] [review]
v03: update libpng to version 1.5.10 (fix unknown handling in pngpread.c)
Attachment #614797 - Attachment is obsolete: true
This still has a broken #endif in png.h (same one I alluded to in comment 7).
+#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
+    defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
+PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
+    int allowed));
+
++#endif

No need for another patch, I'll fix it locally.
(Assignee)

Comment 13

5 years ago
Created attachment 617723 [details] [diff] [review]
v04: update libpng to version 1.5.10

Fixed "+#endif" in png.h
Attachment #617715 - Attachment is obsolete: true
(Assignee)

Comment 14

5 years ago
Created attachment 617763 [details] [diff] [review]
v05: update libpng to version 1.5.10

declares png_handle_unknown() in pngpriv.h
Attachment #617723 - Attachment is obsolete: true
Comment on attachment 617763 [details] [diff] [review]
v05: update libpng to version 1.5.10

v05 looks good on Try.
https://tbpl.mozilla.org/?tree=Try&rev=aba02a77a80b
Attachment #617763 - Flags: review?(joe)
Comment on attachment 617763 [details] [diff] [review]
v05: update libpng to version 1.5.10

Got r+ from joe over IRC.
Attachment #617763 - Flags: review?(joe) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/f22a06ee6a6e
Flags: in-testsuite-
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/f22a06ee6a6e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Depends on: 771394
You need to log in before you can comment on or make changes to this bug.