diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-01 14:08:32 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-01 14:08:32 -0700 |
commit | e95f39f10400746f0dc49c8afe3b3f21cdbbf381 (patch) | |
tree | f40e88e0427b53f36d1e8f0dff339de45f650fb4 /core/src/fpdfapi/fpdf_page | |
parent | 61d25619b1e7647b10689352039966a1394feae6 (diff) | |
download | pdfium-e95f39f10400746f0dc49c8afe3b3f21cdbbf381.tar.xz |
Merge to XFA: Clean up some image decoder classes:
- Use std::vector<uint8_t> instead of raw uint8_t*
- Make ICodec_ScanlineDecoder::GetScanline() return const uint8_t*
- Add FxFreeDeleter, use it in CCodec_ImageDataCache.
- Make CCodec_ImageDataCache encapsulate its data members.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1361053002 .
(cherry picked from commit 022da0014faa103901ec107ed6a33e5ab00c7931)
Review URL: https://codereview.chromium.org/1372993003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index c9bcff6db6..ace7bf925b 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -247,10 +247,10 @@ FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, dest_buf = FX_Alloc2D(uint8_t, pitch, height); dest_size = pitch * height; // Safe since checked alloc returned. for (int row = 0; row < height; row++) { - uint8_t* pLine = pDecoder->GetScanline(row); - if (pLine == NULL) { + const uint8_t* pLine = pDecoder->GetScanline(row); + if (!pLine) break; - } + FXSYS_memcpy(dest_buf + row * pitch, pLine, pitch); } FX_DWORD srcoff = pDecoder->GetSrcOffset(); |