Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: src/codec/SkJpegCodec.cpp

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/codec/SkBmpCodec.cpp ('k') | src/codec/SkRawCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkMSAN.h" 9 #include "SkMSAN.h"
10 #include "SkJpegCodec.h" 10 #include "SkJpegCodec.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 406 }
407 407
408 // Check if we can decode to the requested destination and set the output co lor space 408 // Check if we can decode to the requested destination and set the output co lor space
409 if (!this->setOutputColorSpace(dstInfo)) { 409 if (!this->setOutputColorSpace(dstInfo)) {
410 return kInvalidConversion; 410 return kInvalidConversion;
411 } 411 }
412 412
413 // Remove objects used for sampling. 413 // Remove objects used for sampling.
414 fSwizzler.reset(nullptr); 414 fSwizzler.reset(nullptr);
415 fSrcRow = nullptr; 415 fSrcRow = nullptr;
416 fStorage.free(); 416 fStorage.reset();
417 417
418 // Now, given valid output dimensions, we can start the decompress 418 // Now, given valid output dimensions, we can start the decompress
419 if (!jpeg_start_decompress(fDecoderMgr->dinfo())) { 419 if (!jpeg_start_decompress(fDecoderMgr->dinfo())) {
420 SkCodecPrintf("start decompress failed\n"); 420 SkCodecPrintf("start decompress failed\n");
421 return kInvalidInput; 421 return kInvalidInput;
422 } 422 }
423 423
424 if (options.fSubset) { 424 if (options.fSubset) {
425 fSwizzlerSubset = *options.fSubset; 425 fSwizzlerSubset = *options.fSubset;
426 } 426 }
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 729
730 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 730 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
731 if (linesRead < remainingRows) { 731 if (linesRead < remainingRows) {
732 // FIXME: Handle incomplete YUV decodes without signalling an error. 732 // FIXME: Handle incomplete YUV decodes without signalling an error.
733 return kInvalidInput; 733 return kInvalidInput;
734 } 734 }
735 } 735 }
736 736
737 return kSuccess; 737 return kSuccess;
738 } 738 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpCodec.cpp ('k') | src/codec/SkRawCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698