From d8f575c86838a8f546c90692bfea0bbe30a92dbe Mon Sep 17 00:00:00 2001 From: Zhongjun Chen Date: Tue, 22 May 2012 19:16:44 +0800 Subject: [Skia]: fix TOMBSTONE issue when browsing JPEG image and exiting Gallery When browsing JPEG image and then exiting Gallery, the TOMBSTONE issue occour. This is because JPEG Decode method still access a pointer which has been deleted. This patch can fix it. Change-Id: I3ac3e4b8f37d352a70676abb6d151961e873e459 Author: Zhongjun Chen Signed-off-by: Zhongjun Chen Singed-off-by: Shuo Gao Signed-off-by: Bruce Beare Signed-off-by: Jack Ren Author-tracking-BZ: 37479 --- src/images/SkImageDecoder_libjpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp index fbb6887..33f222c 100644 --- a/src/images/SkImageDecoder_libjpeg.cpp +++ b/src/images/SkImageDecoder_libjpeg.cpp @@ -48,9 +48,9 @@ public: SkJPEGImageIndex() {} virtual ~SkJPEGImageIndex() { jpeg_destroy_huffman_index(index); - delete cinfo->src; jpeg_finish_decompress(cinfo); jpeg_destroy_decompress(cinfo); + delete cinfo->src; free(cinfo); } jpeg_decompress_struct *cinfo; -- cgit v1.1