Bug 881018 - Crash when TiledLayerBuffer::GetScaledTileLength returns 0; r=cwiiis

This commit is contained in:
Jim Chen 2013-07-24 11:17:49 -04:00
Родитель 4c40f10fab
Коммит c44be3735b
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -111,7 +111,16 @@ public:
bool RemoveTile(int x, int y, Tile& aRemovedTile);
uint16_t GetTileLength() const { return TILEDLAYERBUFFER_TILE_SIZE; }
uint32_t GetScaledTileLength() const { return TILEDLAYERBUFFER_TILE_SIZE / mResolution; }
uint32_t GetScaledTileLength() const {
// volatile variables to help investigate bug 881018
volatile float resolution = mResolution;
volatile float fScaledLength = TILEDLAYERBUFFER_TILE_SIZE / mResolution;
volatile uint32_t uiScaledLength = TILEDLAYERBUFFER_TILE_SIZE / mResolution;
if (!uiScaledLength) {
MOZ_CRASH();
}
return uiScaledLength;
}
unsigned int GetTileCount() const { return mRetainedTiles.Length(); }