From 41990c27e1dcbe9d14c34ea3972b95859be0659e Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Mon, 15 Aug 2016 16:23:32 +0100 Subject: [PATCH] Fix Gif Loader using uninitialized variable We were passing in a variable that had no valid address for the newer version of giflib. This caused a crash when loading certain types of gifs (which we did in the Image Scaling Grid demo). Change-Id: Iffc392a06df135390679f15026ef4818c4c50e5f --- platform-abstractions/tizen/image-loaders/loader-gif.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform-abstractions/tizen/image-loaders/loader-gif.cpp b/platform-abstractions/tizen/image-loaders/loader-gif.cpp index 9bb3657..8f8481c 100644 --- a/platform-abstractions/tizen/image-loaders/loader-gif.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-gif.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -259,13 +259,16 @@ bool HandleImageDescriptionRecordType( Bitmap& bitmap, GifFileType* gifInfo, uns bool HandleExtensionRecordType( GifFileType* gifInfo ) { SavedImage image; - image.ExtensionBlocks = NULL; - image.ExtensionBlockCount = 0; GifByteType *extensionByte( NULL ); #ifdef LIBGIF_VERSION_5_1_OR_ABOVE + ExtensionBlock extensionBlocks; + image.ExtensionBlocks = &extensionBlocks; + image.ExtensionBlockCount = 1; int *extensionBlockTypePointer = &image.ExtensionBlocks->Function; #else + image.ExtensionBlocks = NULL; + image.ExtensionBlockCount = 0; int *extensionBlockTypePointer = &image.Function; #endif -- 2.7.4