From 9ca9e297661b4a3ee9c25f68d3f9c8e0c270bda9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 27 Nov 2017 21:24:06 +0000 Subject: Convert CFX_GifContext::GetFrameNum to size_t This CL removes the CollectionSize and updates call locations as needed. Bug: pdfium:774 Change-Id: I813c500b3a17a194407ceb1304252b9b16fe1779 Reviewed-on: https://pdfium-review.googlesource.com/19590 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison --- xfa/fxfa/cxfa_ffwidget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/cxfa_ffwidget.cpp') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 7847bea982..a34e67ae9d 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1985,15 +1985,16 @@ RetainPtr XFA_LoadImageFromBuffer( pProgressiveDecoder->GetHeight(), dibFormat); pBitmap->Clear(0xffffffff); - int32_t nFrames; - if (pProgressiveDecoder->GetFrames(&nFrames) != FXCODEC_STATUS_DECODE_READY || - nFrames <= 0) { + size_t nFrames; + FXCODEC_STATUS status; + std::tie(status, nFrames) = pProgressiveDecoder->GetFrames(); + if (status != FXCODEC_STATUS_DECODE_READY || nFrames == 0) { pBitmap = nullptr; return pBitmap; } - FXCODEC_STATUS status = pProgressiveDecoder->StartDecode( - pBitmap, 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()); + status = pProgressiveDecoder->StartDecode(pBitmap, 0, 0, pBitmap->GetWidth(), + pBitmap->GetHeight()); if (IsFXCodecErrorStatus(status)) { pBitmap = nullptr; return pBitmap; -- cgit v1.2.3