OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "Fuzz.h" | 8 #include "Fuzz.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 SkDebugf("[terminated] Could not start scanline decoder\n"); | 189 SkDebugf("[terminated] Could not start scanline decoder\n"); |
190 return 7; | 190 return 7; |
191 } | 191 } |
192 | 192 |
193 void* dst = bitmap.getAddr(0, 0); | 193 void* dst = bitmap.getAddr(0, 0); |
194 size_t rowBytes = bitmap.rowBytes(); | 194 size_t rowBytes = bitmap.rowBytes(); |
195 uint32_t height = decodeInfo.height(); | 195 uint32_t height = decodeInfo.height(); |
196 switch (codec->getScanlineOrder()) { | 196 switch (codec->getScanlineOrder()) { |
197 case SkCodec::kTopDown_SkScanlineOrder: | 197 case SkCodec::kTopDown_SkScanlineOrder: |
198 case SkCodec::kBottomUp_SkScanlineOrder: | 198 case SkCodec::kBottomUp_SkScanlineOrder: |
199 case SkCodec::kNone_SkScanlineOrder: | |
200 // We do not need to check the return value. On an incomple
te | 199 // We do not need to check the return value. On an incomple
te |
201 // image, memory will be filled with a default value. | 200 // image, memory will be filled with a default value. |
202 codec->getScanlines(dst, height, rowBytes); | 201 codec->getScanlines(dst, height, rowBytes); |
203 break; | 202 break; |
204 case SkCodec::kOutOfOrder_SkScanlineOrder: { | 203 case SkCodec::kOutOfOrder_SkScanlineOrder: { |
205 for (int y = 0; y < decodeInfo.height(); y++) { | 204 for (int y = 0; y < decodeInfo.height(); y++) { |
206 int dstY = codec->outputScanline(y); | 205 int dstY = codec->outputScanline(y); |
207 void* dstPtr = bitmap.getAddr(0, dstY); | 206 void* dstPtr = bitmap.getAddr(0, dstY); |
208 // We complete the loop, even if this call begins to fai
l | 207 // We complete the loop, even if this call begins to fai
l |
209 // due to an incomplete image. This ensures any uniniti
alized | 208 // due to an incomplete image. This ensures any uniniti
alized |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 if (min > max) { | 451 if (min > max) { |
453 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); | 452 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); |
454 this->signalBoring(); | 453 this->signalBoring(); |
455 } | 454 } |
456 float f = std::abs(this->nextF()); | 455 float f = std::abs(this->nextF()); |
457 if (!std::isnormal(f) && f != 0.0) { | 456 if (!std::isnormal(f) && f != 0.0) { |
458 this->signalBoring(); | 457 this->signalBoring(); |
459 } | 458 } |
460 return min + fmod(f, (max - min + 1)); | 459 return min + fmod(f, (max - min + 1)); |
461 } | 460 } |
OLD | NEW |