Chromium Code Reviews| Index: ui/gfx/icon_util.cc |
| diff --git a/ui/gfx/icon_util.cc b/ui/gfx/icon_util.cc |
| index 4f4b4b7c68f576b10d499f67c43a9dc466c56bd7..bff7c88034f2914f166447d5a6f67e57b940f2d0 100644 |
| --- a/ui/gfx/icon_util.cc |
| +++ b/ui/gfx/icon_util.cc |
| @@ -331,7 +331,7 @@ bool IconUtil::CreateIconFileFromSkBitmap(const SkBitmap& bitmap, |
| std::vector<uint8> buffer(buffer_size); |
| ICONDIR* icon_dir = reinterpret_cast<ICONDIR*>(&buffer[0]); |
| icon_dir->idType = kResourceTypeIcon; |
| - icon_dir->idCount = bitmap_count; |
| + icon_dir->idCount = static_cast<WORD>(bitmap_count); |
| size_t icon_dir_count = bitmap_count - 1; // Note DCHECK(!bitmaps.empty())! |
| // Increment counts if a PNG entry will be added. |
| @@ -358,8 +358,8 @@ bool IconUtil::CreateIconFileFromSkBitmap(const SkBitmap& bitmap, |
| entry->bHeight = 0; |
| entry->wPlanes = 1; |
| entry->wBitCount = 32; |
| - entry->dwBytesInRes = png_bytes->size(); |
| - entry->dwImageOffset = offset; |
| + entry->dwBytesInRes = static_cast<DWORD>(png_bytes->size()); |
|
jschuh
2013/01/14 21:31:39
It doesn't look like we validate the size anywhere
scottmg
2013/01/14 21:45:00
No.
I was trying to imagine where a case where it
jschuh
2013/01/14 22:14:35
Sounds good to me. You can convert the DCHECKs on
|
| + entry->dwImageOffset = static_cast<DWORD>(offset); |
| memcpy(&buffer[offset], png_bytes->front(), png_bytes->size()); |
| offset += png_bytes->size(); |
| } |