Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ SplashDecodeGif(Splash * splash, GifFileType * gif)
ImageRect dstRect;
rgbquad_t fillColor = 0; // 0 is transparent

if (transparentColor < 0) {
if (colorMap &&
colorMap->Colors &&
transparentColor < 0) {
fillColor= MAKE_QUAD_GIF(
colorMap->Colors[gif->SBackGroundColor], 0xff);
Comment on lines +283 to 286
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont we need to check for colorMap->Colors here too

colorMapBuf[i] = MAKE_QUAD_GIF(colorMap->Colors[i], 0xff);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem isn't the Colors member, it is colorMap. I'm not sure the new check for Colors is necessary.
If you look at giflib's allocator for this it will never return a colorMap without Colors allocated and the giflib code itself assumes that this is true.

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
fp_gtk_check_version = dl_symbol("gtk_check_version");

/* GLib */
fp_glib_check_version = dlsym(gtk3_libhandle, "glib_check_version");
if (!fp_glib_check_version) {
dlerror();
}
fp_glib_check_version = dl_symbol("glib_check_version");
fp_g_free = dl_symbol("g_free");
fp_g_object_unref = dl_symbol("g_object_unref");

Expand Down