Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/fpdfapi/page/pageint.h" | 7 #include "core/fpdfapi/page/pageint.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 i2 = (int)Pop(); | 336 i2 = (int)Pop(); |
| 337 Push(i1 ^ i2); | 337 Push(i1 ^ i2); |
| 338 break; | 338 break; |
| 339 case PSOP_NOT: | 339 case PSOP_NOT: |
| 340 i1 = (int)Pop(); | 340 i1 = (int)Pop(); |
| 341 Push((int)!i1); | 341 Push((int)!i1); |
| 342 break; | 342 break; |
| 343 case PSOP_BITSHIFT: { | 343 case PSOP_BITSHIFT: { |
| 344 int shift = (int)Pop(); | 344 int shift = (int)Pop(); |
| 345 int i = (int)Pop(); | 345 int i = (int)Pop(); |
| 346 if (shift > 0) { | 346 if (shift < -31 || shift > 31) |
|
Tom Sepez
2016/10/12 20:17:58
http://en.cppreference.com/w/cpp/language/operator
| |
| 347 Push(0); | |
| 348 else if (shift >= 0) | |
| 347 Push(i << shift); | 349 Push(i << shift); |
| 348 } else { | 350 else |
| 349 Push(i >> -shift); | 351 Push(i >> -shift); |
| 350 } | |
| 351 break; | 352 break; |
| 352 } | 353 } |
| 353 case PSOP_TRUE: | 354 case PSOP_TRUE: |
| 354 Push(1); | 355 Push(1); |
| 355 break; | 356 break; |
| 356 case PSOP_FALSE: | 357 case PSOP_FALSE: |
| 357 Push(0); | 358 Push(0); |
| 358 break; | 359 break; |
| 359 case PSOP_POP: | 360 case PSOP_POP: |
| 360 Pop(); | 361 Pop(); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 return m_Type == Type::kType2ExpotentialInterpolation | 853 return m_Type == Type::kType2ExpotentialInterpolation |
| 853 ? static_cast<const CPDF_ExpIntFunc*>(this) | 854 ? static_cast<const CPDF_ExpIntFunc*>(this) |
| 854 : nullptr; | 855 : nullptr; |
| 855 } | 856 } |
| 856 | 857 |
| 857 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { | 858 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { |
| 858 return m_Type == Type::kType3Stitching | 859 return m_Type == Type::kType3Stitching |
| 859 ? static_cast<const CPDF_StitchFunc*>(this) | 860 ? static_cast<const CPDF_StitchFunc*>(this) |
| 860 : nullptr; | 861 : nullptr; |
| 861 } | 862 } |
| OLD | NEW |