Bug 1203078 - whitelist gdk-pixbuf image formats. r=dan

This commit is contained in:
Lee Salzman 2015-09-11 00:34:32 -04:00
parent e790d5b2a7
commit ce355abfd3

View File

@ -107,17 +107,19 @@ nsAppShell::Init()
if (PR_GetEnv("MOZ_DEBUG_PAINTS"))
gdk_window_set_debug_updates(TRUE);
// Disable JasPer module in GDK-PixBuf. See bug 1197059.
// Whitelist of only common, stable formats - see bugs 1197059 and 1203078
GSList* pixbufFormats = gdk_pixbuf_get_formats();
for (GSList* iter = pixbufFormats; iter; iter = iter->next) {
GdkPixbufFormat* format = static_cast<GdkPixbufFormat*>(iter->data);
gchar* name = gdk_pixbuf_format_get_name(format);
bool isJasper = strcmp(name, "jpeg2000") == 0;
g_free(name);
if (isJasper) {
gdk_pixbuf_format_set_disabled(format, TRUE);
break;
if (strcmp(name, "jpeg") &&
strcmp(name, "png") &&
strcmp(name, "gif") &&
strcmp(name, "bmp") &&
strcmp(name, "ico")) {
gdk_pixbuf_format_set_disabled(format, TRUE);
}
g_free(name);
}
g_slist_free(pixbufFormats);