Bug 549668 - check that mozilla.widget.render-mode pref value is within valid range. r=vlad

This commit is contained in:
Jonathan Kew 2010-03-03 09:27:08 +00:00
parent 4c4911bf50
commit 85144c835a

View File

@ -164,7 +164,7 @@ gfxWindowsPlatform::gfxWindowsPlatform()
PRInt32 rmode;
if (NS_SUCCEEDED(pref->GetIntPref("mozilla.widget.render-mode", &rmode))) {
if (rmode >= 0 || rmode < RENDER_MODE_MAX) {
if (rmode >= 0 && rmode < RENDER_MODE_MAX) {
#ifndef CAIRO_HAS_DDRAW_SURFACE
if (rmode == RENDER_DDRAW || rmode == RENDER_DDRAW_GL)
rmode = RENDER_IMAGE_STRETCH24;