| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 SkDebugf("[terminated] Could not start scanline decoder\n"); | 180 SkDebugf("[terminated] Could not start scanline decoder\n"); |
| 181 return 7; | 181 return 7; |
| 182 } | 182 } |
| 183 | 183 |
| 184 void* dst = bitmap.getAddr(0, 0); | 184 void* dst = bitmap.getAddr(0, 0); |
| 185 size_t rowBytes = bitmap.rowBytes(); | 185 size_t rowBytes = bitmap.rowBytes(); |
| 186 uint32_t height = decodeInfo.height(); | 186 uint32_t height = decodeInfo.height(); |
| 187 switch (codec->getScanlineOrder()) { | 187 switch (codec->getScanlineOrder()) { |
| 188 case SkCodec::kTopDown_SkScanlineOrder: | 188 case SkCodec::kTopDown_SkScanlineOrder: |
| 189 case SkCodec::kBottomUp_SkScanlineOrder: | 189 case SkCodec::kBottomUp_SkScanlineOrder: |
| 190 case SkCodec::kNone_SkScanlineOrder: | |
| 191 // We do not need to check the return value. On an incomple
te | 190 // We do not need to check the return value. On an incomple
te |
| 192 // image, memory will be filled with a default value. | 191 // image, memory will be filled with a default value. |
| 193 codec->getScanlines(dst, height, rowBytes); | 192 codec->getScanlines(dst, height, rowBytes); |
| 194 break; | 193 break; |
| 195 case SkCodec::kOutOfOrder_SkScanlineOrder: { | 194 case SkCodec::kOutOfOrder_SkScanlineOrder: { |
| 196 for (int y = 0; y < decodeInfo.height(); y++) { | 195 for (int y = 0; y < decodeInfo.height(); y++) { |
| 197 int dstY = codec->outputScanline(y); | 196 int dstY = codec->outputScanline(y); |
| 198 void* dstPtr = bitmap.getAddr(0, dstY); | 197 void* dstPtr = bitmap.getAddr(0, dstY); |
| 199 // We complete the loop, even if this call begins to fai
l | 198 // We complete the loop, even if this call begins to fai
l |
| 200 // due to an incomplete image. This ensures any uniniti
alized | 199 // due to an incomplete image. This ensures any uniniti
alized |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 if (min > max) { | 416 if (min > max) { |
| 418 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); | 417 SkDebugf("Check mins and maxes (%f, %f)\n", min, max); |
| 419 this->signalBoring(); | 418 this->signalBoring(); |
| 420 } | 419 } |
| 421 float f = std::abs(this->nextF()); | 420 float f = std::abs(this->nextF()); |
| 422 if (!std::isnormal(f) && f != 0.0) { | 421 if (!std::isnormal(f) && f != 0.0) { |
| 423 this->signalBoring(); | 422 this->signalBoring(); |
| 424 } | 423 } |
| 425 return min + fmod(f, (max - min + 1)); | 424 return min + fmod(f, (max - min + 1)); |
| 426 } | 425 } |
| OLD | NEW |