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

Side by Side Diff: core/fpdfapi/page/fpdf_page_func.cpp

Issue 2414473003: Handle undefined shifts in CPDF_PSEngine. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698