| 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 <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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |