After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635747 - [PATCH] png load doesn't check for failed reads and short files
[PATCH] png load doesn't check for failed reads and short files
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2010-11-25 04:42 UTC by Patrick Horgan
Modified: 2010-12-20 20:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch to fix the problem. (2.87 KB, patch)
2010-11-25 04:42 UTC, Patrick Horgan
none Details | Review

Description Patrick Horgan 2010-11-25 04:42:41 UTC
Created attachment 175215 [details] [review]
A patch to fix the problem.

operations/external/png-load.c doesn't check for failed reads when reading a png file.  Add check and at Martin Nordhalts request, move it into a routine that opens the file, checks the header to validate that it's really a png file, then returns the handle.
Comment 1 Øyvind Kolås (pippin) 2010-12-20 20:39:25 UTC
commit 6c4fe8ab610457517907afa6156698139af1e9d8
Author: Patrick Horgan <phorgan1@gmail.com>
Date:   Fri Nov 19 18:31:34 2010 -0800

    png-load: check for failed read
    
    Check fread return status for error so that if the file is short, then will 
    able to give a more meaningful error. Also abstract current code out of two
    routines that open the file and read it.