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

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

Issue 1828323002: Catch invalid images in get_images_from_skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | tools/get_images_from_skps.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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 if (fSwizzler) { 496 if (fSwizzler) {
497 // use swizzler to sample row 497 // use swizzler to sample row
498 fSwizzler->swizzle(dst, dstRow); 498 fSwizzler->swizzle(dst, dstRow);
499 dst = SkTAddOffset<JSAMPLE>(dst, dstRowBytes); 499 dst = SkTAddOffset<JSAMPLE>(dst, dstRowBytes);
500 } else { 500 } else {
501 dstRow = SkTAddOffset<JSAMPLE>(dstRow, dstRowBytes); 501 dstRow = SkTAddOffset<JSAMPLE>(dstRow, dstRowBytes);
502 } 502 }
503 } 503 }
504 504
505 return kSuccess; 505 return kUnimplemented;
506 } 506 }
507 507
508 void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& options) { 508 void SkJpegCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& options) {
509 SkSwizzler::SrcConfig srcConfig = SkSwizzler::kUnknown; 509 SkSwizzler::SrcConfig srcConfig = SkSwizzler::kUnknown;
510 if (JCS_CMYK == fDecoderMgr->dinfo()->out_color_space) { 510 if (JCS_CMYK == fDecoderMgr->dinfo()->out_color_space) {
511 srcConfig = SkSwizzler::kCMYK; 511 srcConfig = SkSwizzler::kCMYK;
512 } else { 512 } else {
513 // If the out_color_space is not CMYK, the only reason we would need a s wizzler is 513 // If the out_color_space is not CMYK, the only reason we would need a s wizzler is
514 // for sampling and/or subsetting. 514 // for sampling and/or subsetting.
515 switch (dstInfo.colorType()) { 515 switch (dstInfo.colorType()) {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 889
890 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 890 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
891 if (linesRead < remainingRows) { 891 if (linesRead < remainingRows) {
892 // FIXME: Handle incomplete YUV decodes without signalling an error. 892 // FIXME: Handle incomplete YUV decodes without signalling an error.
893 return kInvalidInput; 893 return kInvalidInput;
894 } 894 }
895 } 895 }
896 896
897 return kSuccess; 897 return kSuccess;
898 } 898 }
OLDNEW
« no previous file with comments | « no previous file | tools/get_images_from_skps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698