Last Comment Bug 392867 - PNG encoder error handler incorrectly returns to caller
: PNG encoder error handler incorrectly returns to caller
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: Trunk
: All All
: -- major (vote)
: mozilla11
Assigned To: Glenn Randers-Pehrson
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks: 700193
  Show dependency treegraph
 
Reported: 2007-08-20 05:20 PDT by Glenn Randers-Pehrson
Modified: 2011-12-22 12:20 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Separate warning and error handlers with longjmp from error (3.14 KB, patch)
2007-08-20 05:20 PDT, Glenn Randers-Pehrson
no flags Details | Diff | Splinter Review
v01: separate Warning and Error Callbacks, updated directory to "image" (3.21 KB, patch)
2011-10-21 20:49 PDT, Glenn Randers-Pehrson
joe: review+
Details | Diff | Splinter Review

Description Glenn Randers-Pehrson 2007-08-20 05:20:25 PDT
Created attachment 277380 [details] [diff] [review]
Separate warning and error handlers with longjmp from error

Libpng requires the error handler not to return to the caller.  The png decoder is doing this correctly, but the png decoder returns, which will probably lead to stack corruption and a crash.  It is supposed to perform a longjmp instead.  The attached patch separates the error and warning handlers, and does a longjmp from the error handler.
Comment 1 Glenn Randers-Pehrson 2007-08-20 05:22:33 PDT
I meant to say "but the png encoder returns"
Comment 2 Glenn Randers-Pehrson 2007-08-20 05:44:22 PDT
The patch is only applicable to the trunk.  The branch uses libpng's default error handler and should be OK as is.
Comment 3 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-08-21 17:51:26 PDT
Glenn: are you going to ask for review on the patch?
Comment 4 Glenn Randers-Pehrson 2007-08-21 19:28:29 PDT
Yes, but I wanted to give the TryServer a shot first.  Also I would like to generate a test case.
Comment 5 Glenn Randers-Pehrson 2011-10-21 20:49:42 PDT
Created attachment 568841 [details] [diff] [review]
v01: separate Warning and Error Callbacks, updated directory to "image"
Comment 6 Glenn Randers-Pehrson 2011-10-21 20:52:06 PDT
Someone please run this through the try server.
Comment 7 Joe Drew (not getting mail) 2011-12-13 19:01:28 PST
This is currently running through Try: https://tbpl.mozilla.org/?tree=Try&rev=ff7ed4731b86
Comment 8 Mozilla RelEng Bot 2011-12-13 23:20:33 PST
Try run for ff7ed4731b86 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=ff7ed4731b86
Results (out of 263 total builds):
    exception: 2
    success: 231
    warnings: 27
    failure: 3
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jdrew@mozilla.com-ff7ed4731b86
Comment 9 Glenn Randers-Pehrson 2011-12-14 04:36:45 PST
Comment on attachment 568841 [details] [diff] [review]
v01: separate Warning and Error Callbacks, updated directory to "image"

None of the failures appear to be related to this patch.
Comment 10 Joe Drew (not getting mail) 2011-12-14 12:00:25 PST
http://hg.mozilla.org/mozilla-central/rev/11eb2aecc7c3
Comment 11 Mozilla RelEng Bot 2011-12-22 12:20:29 PST
Try run for ff7ed4731b86 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=ff7ed4731b86
Results (out of 272 total builds):
    exception: 2
    success: 231
    warnings: 27
    failure: 11
    other: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jdrew@mozilla.com-ff7ed4731b86

Note You need to log in before you can comment on or make changes to this bug.