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

Side by Side Diff: core/fxcodec/codec/fx_codec_tiff.cpp

Issue 2284063002: Fix for #618267. Adding a method to determine if multiplication has (Closed)
Patch Set: creating a patch and modifying readme for libtiff Created 4 years, 3 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 | third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch » ('j') | 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/fxcodec/codec/codec_int.h" 7 #include "core/fxcodec/codec/codec_int.h"
8 #include "core/fxcodec/include/fx_codec.h" 8 #include "core/fxcodec/include/fx_codec.h"
9 #include "core/fxge/include/fx_dib.h" 9 #include "core/fxge/include/fx_dib.h"
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 void _TIFFmemcpy(void* des, const void* src, tmsize_t size) { 74 void _TIFFmemcpy(void* des, const void* src, tmsize_t size) {
75 FXSYS_memcpy(des, src, (size_t)size); 75 FXSYS_memcpy(des, src, (size_t)size);
76 } 76 }
77 77
78 int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) { 78 int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) {
79 return FXSYS_memcmp(ptr1, ptr2, (size_t)size); 79 return FXSYS_memcmp(ptr1, ptr2, (size_t)size);
80 } 80 }
81 81
82 int _TIFFIfMultiplicationOverflow(tmsize_t op1, tmsize_t op2) {
83 return op1 > std::numeric_limits<tmsize_t>::max() / op2;
84 }
85
82 TIFFErrorHandler _TIFFwarningHandler = nullptr; 86 TIFFErrorHandler _TIFFwarningHandler = nullptr;
83 TIFFErrorHandler _TIFFerrorHandler = nullptr; 87 TIFFErrorHandler _TIFFerrorHandler = nullptr;
84 88
85 namespace { 89 namespace {
86 90
87 tsize_t tiff_read(thandle_t context, tdata_t buf, tsize_t length) { 91 tsize_t tiff_read(thandle_t context, tdata_t buf, tsize_t length) {
88 CCodec_TiffContext* pTiffContext = (CCodec_TiffContext*)context; 92 CCodec_TiffContext* pTiffContext = (CCodec_TiffContext*)context;
89 if (!pTiffContext->io_in()->ReadBlock(buf, pTiffContext->offset(), length)) 93 if (!pTiffContext->io_in()->ReadBlock(buf, pTiffContext->offset(), length))
90 return 0; 94 return 0;
91 95
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 455 }
452 456
453 bool CCodec_TiffModule::Decode(CCodec_TiffContext* ctx, 457 bool CCodec_TiffModule::Decode(CCodec_TiffContext* ctx,
454 class CFX_DIBitmap* pDIBitmap) { 458 class CFX_DIBitmap* pDIBitmap) {
455 return ctx->Decode(pDIBitmap); 459 return ctx->Decode(pDIBitmap);
456 } 460 }
457 461
458 void CCodec_TiffModule::DestroyDecoder(CCodec_TiffContext* ctx) { 462 void CCodec_TiffModule::DestroyDecoder(CCodec_TiffContext* ctx) {
459 delete ctx; 463 delete ctx;
460 } 464 }
OLDNEW
« no previous file with comments | « no previous file | third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698