aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Pisanov <Nikolay.Pisanov@teleca.com>2012-05-02 11:17:36 +0400
committerJohan Redestig <johan.redestig@sonymobile.com>2012-08-27 09:19:55 +0200
commitc005897dd8d0bcbeb7f715fef601edec7128eb91 (patch)
tree023ad19e9db50275f95a083b2ce2abd812fcd064
parentc2ad1992ce99225f79a05ecaed619ec6b52f7bb1 (diff)
downloadexternal_skia-c005897dd8d0bcbeb7f715fef601edec7128eb91.zip
external_skia-c005897dd8d0bcbeb7f715fef601edec7128eb91.tar.gz
external_skia-c005897dd8d0bcbeb7f715fef601edec7128eb91.tar.bz2
Fix access to freed memory
Source should be freed after all jpeg operations completed since it is used by these operations. Change-Id: Ieb0741e1d219dc0513133a94d47df86b5f95cf29
-rw-r--r--src/images/SkImageDecoder_libjpeg.cpp2
1 files changed, 1 insertions, 1 deletions
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;