Closed
Bug 403578
Opened 17 years ago
Closed 17 years ago
Memory corruption in GIF decoder due to tpixel outside of colormap
Categories
(Core Graveyard :: Image: Painting, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: bc, Assigned: alfredkayser)
References
()
Details
(Keywords: crash, regression, Whiteboard: [sg:critical?] post 1.8-branch)
Attachments
(4 files)
13.75 KB,
text/plain
|
Details | |
11.07 KB,
text/plain
|
Details | |
98.38 KB,
image/gif
|
Details | |
1.96 KB,
patch
|
pavlov
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
blaming thebes based on the first part of the backtrace.
======= Backtrace: =========
/lib/libc.so.6[0xe5c583]
/lib/libc.so.6(__libc_malloc+0x7e)[0xe5debe]
/usr/lib/libstdc++.so.6(_Znwj+0x27)[0x4cb0547]
/work/mozilla/builds/1.9.0/mozilla/firefox-debug/dist/bin/components/libgkgfxthebes.so[0x1a10113]
Flags: blocking1.9?
Reporter | ||
Comment 1•17 years ago
|
||
Igor, I found this looking at crash-reports for js related stacks. maybe this is something you could look at?
AFAIK, this just means that a malloc() done by thebes triggered a heap check which discovered the corruption. Doesn't mean that thebes is responsible for it. If it's reproducible with the given testcase, should be easy to figure out the actual problem using valgrind/purify/etc.
Reporter | ||
Comment 3•17 years ago
|
||
I'm thinking ImageLib here. Maybe the same issue as bug 403580
Reporter | ||
Comment 4•17 years ago
|
||
Reporter | ||
Comment 5•17 years ago
|
||
over to imagegfx.
Component: GFX: Thebes → Image: GFX
QA Contact: thebes → image.gfx
Reporter | ||
Comment 6•17 years ago
|
||
bug 143046 looks like the culprit.
Assignee | ||
Comment 7•17 years ago
|
||
Bug 4033363 has covered this 'imgContainer:DrawFrameTo' problem.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 8•17 years ago
|
||
And confirmed that with my patch in 403363 the URL above (http://omnimaga.org/index.php?showtopic=1548) doesn't crash anymore.
Assignee | ||
Comment 9•17 years ago
|
||
Actually, the crash is indeed somewhere in nsGIFDecoder2.cpp, on the line with:
mColormap[mGIFStruct.tpixel] = 0;
The offending gif image seems to have a tpixel outside the colormap (globa_colormap_depth=3 (so 8 colors), and tpixel =15.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Updated•17 years ago
|
Status: REOPENED → ASSIGNED
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → alfredkayser
Status: ASSIGNED → NEW
Assignee | ||
Comment 10•17 years ago
|
||
The image that causes the crash of http://img249.imageshack.us/img249/7711/ptiani1fm3.gif
Comment 11•17 years ago
|
||
Content induced crash - so marking blocking and making a p2.
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Assignee | ||
Comment 12•17 years ago
|
||
The crashing image has tpixel 15 and depth 3, and other image viewers (such as IrfanView and Opera) report this image has 4 bpp. So, for this image we need to change the depth to accomodiate for the tpixel value.
This didn't crash before as we always used colormaps with 256 entries, but with the patch from bug 143046, palettes are sized to the actual depth.
So, to fix this issue, we increase the depth value till tpixel also fits in the colormap.
(note: the other solution would be to ignore tpixel values outside the depth range, but then this image still doesn't display correctly)
Attachment #289291 -
Flags: review?
Assignee | ||
Updated•17 years ago
|
Attachment #289291 -
Flags: review? → review?(pavlov)
Assignee | ||
Updated•17 years ago
|
Attachment #289291 -
Flags: superreview?(tor)
Attachment #289291 -
Flags: superreview?(tor) → superreview+
Updated•17 years ago
|
Attachment #289291 -
Flags: review?(pavlov) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #289291 -
Flags: approval1.9?
Comment 13•17 years ago
|
||
Comment on attachment 289291 [details] [diff] [review]
Patch to fix depth for images with tpixel outside the depth range
(clearing a?, it's a blocker, doesn't need approval, please land)
Attachment #289291 -
Flags: approval1.9?
Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Comment 14•17 years ago
|
||
Checking in nsGIFDecoder2.cpp;
/cvsroot/mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp,v <-- nsGIFDec
oder2.cpp
new revision: 1.88; previous revision: 1.87
done
Checked in.
This regressed between 2007-11-07 and 2007-11-08, when bug 143046 was fixed, so a regression from that bug.
So since this is a recent regression, can this bug be opened up?
Blocks: slowGIF
Status: NEW → RESOLVED
Closed: 17 years ago → 17 years ago
Keywords: checkin-needed → regression
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite?
Updated•17 years ago
|
Summary: glibc detected firefox-bin: malloc(): memory corruption → Memory corruption in GIF decoder due to tpixel outside of colormap
Assignee | ||
Comment 15•17 years ago
|
||
Followup bug to address the regression is bug 408310.
Updated•17 years ago
|
Flags: wanted1.8.1.x-
Whiteboard: [sg:critical?] post 1.8-branch
Updated•17 years ago
|
Group: security
Assignee | ||
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•