From c005897dd8d0bcbeb7f715fef601edec7128eb91 Mon Sep 17 00:00:00 2001 From: Nikolay Pisanov Date: Wed, 2 May 2012 11:17:36 +0400 Subject: Fix access to freed memory Source should be freed after all jpeg operations completed since it is used by these operations. Change-Id: Ieb0741e1d219dc0513133a94d47df86b5f95cf29 --- src/images/SkImageDecoder_libjpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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