Closed Bug 108318 Opened 23 years ago Closed 23 years ago

Make ICO decoder non-incremental

Categories

(Core :: Graphics: ImageLib, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: hyatt, Assigned: hyatt)

Details

Attachments

(1 file, 5 obsolete files)

This bug is tracking adjusting the ICO decoder to be non-incremental (since being incremental on a 16x16 icon is rather pointless anyway) and is also tracking ensuring that the alpha info is set first.
Attached patch Make ICO decoder more robust. (obsolete) (deleted) — Splinter Review
This patch stops using the bitmap info header width/height fields in favor of the icon dir entry width/height fields. What I'm seeing with some favicons on the net is that the width/height fields are sometimes garbage in the bitmap info header. It appears that they're relying on the decoder only using the icon dir entry width/height. While I'm sure the ico files are technically malformed, this makes the ICO decoder more robust in that it can successfully view those files.
Looking for r/sr on this patch.
Status: NEW → ASSIGNED
Attachment #56440 - Attachment is obsolete: true
Attachment #56441 - Attachment is obsolete: true
Attached patch Avoid re-decoding the alpha mask. (obsolete) (deleted) — Splinter Review
Attachment #56449 - Attachment is obsolete: true
Attached patch Cleanup. (obsolete) (deleted) — Splinter Review
Comment on attachment 56454 [details] [diff] [review] Cleanup. r=pavlov
Attachment #56454 - Flags: review+
Comment on attachment 56454 [details] [diff] [review] Cleanup. sr=jst
Attachment #56454 - Flags: superreview+
Attachment #56454 - Attachment is obsolete: true
Attachment #56698 - Attachment is obsolete: true
Target Milestone: --- → mozilla0.9.6
Comment on attachment 56699 [details] [diff] [review] Non-incremental decoder, sets alpha before image data. r=pavlov
Attachment #56699 - Flags: review+
Comment on attachment 56699 [details] [diff] [review] Non-incremental decoder, sets alpha before image data. >Index: decoders/bmp/nsICODecoder.cpp >+ mFrame->GetImageBytesPerRow(&bpr); >+ for (PRUint32 i = 0; i < mDirEntry.mHeight; i++) { >+ PRUint32 offset = bpr*i; >+ mFrame->SetImageData(mDecodedBuffer+offset, bpr, offset); >+ } how about this instead: for (PRUint32 offset = 0, i = 0; i < mDirEntry.mHeight; ++i, offset += bpr) mFrame->SetImageData(mDecodedBuffer + offset, bpr, offset); >+ for (PRUint32 i = 0; i < mDirEntry.mHeight; i++) { >+ PRUint32 offset = bpr*i; >+ mFrame->SetAlphaData(mAlphaBuffer+offset, bpr, offset); >+ } likewise, here.
strength reduce as darin suggested, and sr=waterson.
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
If reduction in strength is appropriate, why not also eliminate the induction variable (i)? for (PRUint32 offset = 0, limit = mDirEntry.mHeight * bpr; offset < limit; offset += bpr) mFrame->SetImageData(mDecodedBuffer + offset, bpr, offset); /be
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: