mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 1385409 - Ignore ICO resource entries which contain little or no data. r=tnikkel
This commit is contained in:
parent
833d108847
commit
9bc359ef2c
@ -163,10 +163,15 @@ nsICODecoder::ReadDirEntry(const char* aData)
|
||||
e.mBytesInRes = LittleEndian::readUint32(aData + 8);
|
||||
e.mImageOffset = offset;
|
||||
e.mSize = IntSize(e.mWidth, e.mHeight);
|
||||
if (e.mWidth == 0 || e.mHeight == 0) {
|
||||
mUnsizedDirEntries.AppendElement(e);
|
||||
} else {
|
||||
mDirEntries.AppendElement(e);
|
||||
|
||||
// Only accept entries with sufficient resource data to actually contain
|
||||
// some image data.
|
||||
if (e.mBytesInRes > BITMAPINFOSIZE) {
|
||||
if (e.mWidth == 0 || e.mHeight == 0) {
|
||||
mUnsizedDirEntries.AppendElement(e);
|
||||
} else {
|
||||
mDirEntries.AppendElement(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user