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

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

Issue 1861403002: Rename FX_SAFE_DWORD to FX_SAFE_UINT32 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | « core/fxcodec/codec/fx_codec_jpeg.cpp ('k') | core/fxcodec/jbig2/JBig2_Image.cpp » ('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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return; 294 return;
295 OPJ_UINT32 offset = 1 << (prec - 1); 295 OPJ_UINT32 offset = 1 << (prec - 1);
296 OPJ_UINT32 upb = (1 << prec) - 1; 296 OPJ_UINT32 upb = (1 << prec) - 1;
297 OPJ_UINT32 yw = img->comps[0].w; 297 OPJ_UINT32 yw = img->comps[0].w;
298 OPJ_UINT32 yh = img->comps[0].h; 298 OPJ_UINT32 yh = img->comps[0].h;
299 OPJ_UINT32 cbw = img->comps[1].w; 299 OPJ_UINT32 cbw = img->comps[1].w;
300 OPJ_UINT32 cbh = img->comps[1].h; 300 OPJ_UINT32 cbh = img->comps[1].h;
301 OPJ_UINT32 crw = img->comps[2].w; 301 OPJ_UINT32 crw = img->comps[2].w;
302 bool extw = sycc420_must_extend_cbcr(yw, cbw); 302 bool extw = sycc420_must_extend_cbcr(yw, cbw);
303 bool exth = sycc420_must_extend_cbcr(yh, cbh); 303 bool exth = sycc420_must_extend_cbcr(yh, cbh);
304 FX_SAFE_DWORD safeSize = yw; 304 FX_SAFE_UINT32 safeSize = yw;
305 safeSize *= yh; 305 safeSize *= yh;
306 if (!safeSize.IsValid()) 306 if (!safeSize.IsValid())
307 return; 307 return;
308 int* r = FX_Alloc(int, safeSize.ValueOrDie()); 308 int* r = FX_Alloc(int, safeSize.ValueOrDie());
309 int* g = FX_Alloc(int, safeSize.ValueOrDie()); 309 int* g = FX_Alloc(int, safeSize.ValueOrDie());
310 int* b = FX_Alloc(int, safeSize.ValueOrDie()); 310 int* b = FX_Alloc(int, safeSize.ValueOrDie());
311 int* d0 = r; 311 int* d0 = r;
312 int* d1 = g; 312 int* d1 = g;
313 int* d2 = b; 313 int* d2 = b;
314 const int* y = img->comps[0].data; 314 const int* y = img->comps[0].data;
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 bool CCodec_JpxModule::Decode(CJPX_Decoder* pDecoder, 890 bool CCodec_JpxModule::Decode(CJPX_Decoder* pDecoder,
891 uint8_t* dest_data, 891 uint8_t* dest_data,
892 int pitch, 892 int pitch,
893 const std::vector<uint8_t>& offsets) { 893 const std::vector<uint8_t>& offsets) {
894 return pDecoder->Decode(dest_data, pitch, offsets); 894 return pDecoder->Decode(dest_data, pitch, offsets);
895 } 895 }
896 896
897 void CCodec_JpxModule::DestroyDecoder(CJPX_Decoder* pDecoder) { 897 void CCodec_JpxModule::DestroyDecoder(CJPX_Decoder* pDecoder) {
898 delete pDecoder; 898 delete pDecoder;
899 } 899 }
OLDNEW
« no previous file with comments | « core/fxcodec/codec/fx_codec_jpeg.cpp ('k') | core/fxcodec/jbig2/JBig2_Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698