diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 20:42:22 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 20:42:22 +0000 |
commit | 57a529877e65687de1fa4d19d52746427c6896dc (patch) | |
tree | 908f6bf1ca9488045e6d3be3ea4f658910b7328b | |
parent | 319e01f1aad7b81a88c019822def2411ffda0381 (diff) |
Only destroy huffman if build succeeded.
The earlier code assumed that if jpeg_create_huffman_index
succeeded but jpeg_build_huffman_index failed that the
index would still need to be destroyed. This is not the
case. Only call jpeg_destroy_huffman_index if both
succeeded.
BUG=http://b.corp.google.com/issue?id=10263847
Review URL: https://codereview.chromium.org/22859042
git-svn-id: http://skia.googlecode.com/svn/trunk@10954 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/images/SkImageDecoder_libjpeg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp index 788e3526d2..2bd48186ac 100644 --- a/src/images/SkImageDecoder_libjpeg.cpp +++ b/src/images/SkImageDecoder_libjpeg.cpp @@ -143,9 +143,9 @@ public: SkASSERT(fReadHeaderSucceeded); SkASSERT(!fHuffmanCreated); jpeg_create_huffman_index(&fCInfo, &fHuffmanIndex); - fHuffmanCreated = true; SkASSERT(1 == fCInfo.scale_num && 1 == fCInfo.scale_denom); - return jpeg_build_huffman_index(&fCInfo, &fHuffmanIndex); + fHuffmanCreated = jpeg_build_huffman_index(&fCInfo, &fHuffmanIndex); + return fHuffmanCreated; } /** |