Bug 691267

Summary: jbig2dec needs to check malloc() return values
Product: jbig2dec Reporter: Masaki Ushizaka <masaki.ushizaka>
Component: ParsingAssignee: Henry Stiles <henry.stiles>
Status: RESOLVED FIXED    
Severity: enhancement CC: shailesh.mistry
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: check all malloc paths for an error being returned
Patch to check for realloc error paths

Description Masaki Ushizaka 2010-04-27 07:53:49 UTC
There are some codes that doesn't check return values from jbig2_alloc() in the jbig2dec library.
Those should be modified to return appropriate errors.
Comment 1 Shailesh Mistry 2011-11-27 15:39:29 UTC
Created attachment 8160 [details]
check all malloc paths for an error being returned

This patch checks all return paths to ensure that the appropriate error is returned on failure. It has been regression tested and no cluster differences were found.
Comment 2 Henry Stiles 2011-11-28 22:31:37 UTC
Okay Shailesh, please commit.
Comment 3 Shailesh Mistry 2011-11-29 20:40:54 UTC
Patch committed in d20a6cb9f12682804af2e74ec5d6bb75ca9d5410
Comment 4 Shailesh Mistry 2011-12-16 18:54:56 UTC
Created attachment 8227 [details]
Patch to check for realloc error paths

This patch adds to the previous one by catering for the following areas :-

1) All realloc paths have been checked to ensure the correct error is returned on failure

2) code now redundant due to the use of memset has been removed

3) free memory highlighted by valgrind run
Comment 5 Henry Stiles 2012-01-10 16:01:07 UTC
Thanks Shailesh, please commit.
Comment 6 Shailesh Mistry 2012-01-20 21:44:05 UTC
Patch committed in c0573245db4f03c6cdca24906d73151a4e9be3c9