Changeset 302:555d58850cd9
- Timestamp:
- 08/28/08 22:26:26
(3 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Omit array bounds checking on dynamic struct length.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r246 |
r302 |
|
| 13 | 13 | module dwt.graphics.Image; |
|---|
| 14 | 14 | |
|---|
| 15 | | |
|---|
| | 15 | import tango.util.log.Trace; |
|---|
| 16 | 16 | import dwt.DWT; |
|---|
| 17 | 17 | import dwt.DWTError; |
|---|
| … | … | |
| 713 | 713 | paletteData = new PaletteData(rgbs); |
|---|
| 714 | 714 | for (int i = 0; i < colorPalette.Count; i++) { |
|---|
| 715 | | if (((palette.Entries[i] >> 24) & 0xFF) is 0 && (colorPalette.Flags & Gdip.PaletteFlagsHasAlpha) !is 0) { |
|---|
| | 715 | // DWT: access palette.Entries without array bounds checking |
|---|
| | 716 | if (((*(palette.Entries.ptr + i) >> 24) & 0xFF) is 0 && (colorPalette.Flags & Gdip.PaletteFlagsHasAlpha) !is 0) { |
|---|
| 716 | 717 | transparentPixel = i; |
|---|
| 717 | 718 | } |
|---|
| 718 | | rgbs[i] = new RGB(((palette.Entries[i] & 0xFF0000) >> 16), ((palette.Entries[i] & 0xFF00) >> 8), ((palette.Entries[i] & 0xFF) >> 0)); |
|---|
| | 719 | rgbs[i] = new RGB(((*(palette.Entries.ptr + i) & 0xFF0000) >> 16), ((*(palette.Entries.ptr + i) & 0xFF00) >> 8), ((*(palette.Entries.ptr + i) & 0xFF) >> 0)); |
|---|
| 719 | 720 | } |
|---|
| 720 | 721 | OS.HeapFree(hHeap, 0, palette); |
|---|