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

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

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: fix an undefined variable Created 4 years, 1 month 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
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/ccodec_progressivedecoder.h" 7 #include "core/fxcodec/codec/ccodec_progressivedecoder.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 } else { 333 } else {
334 uint32_t dwConsume = m_SrcSize - dwAvail; 334 uint32_t dwConsume = m_SrcSize - dwAvail;
335 if (dwAvail) { 335 if (dwAvail) {
336 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail); 336 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
337 } 337 }
338 if (dwSize > dwConsume) { 338 if (dwSize > dwConsume) {
339 dwSize = dwConsume; 339 dwSize = dwConsume;
340 } 340 }
341 } 341 }
342 if (!m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize)) { 342 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize);
343 if (readSize != dwSize && !m_pFile->IsEOF()) {
343 err_status = FXCODEC_STATUS_ERR_READ; 344 err_status = FXCODEC_STATUS_ERR_READ;
344 return false; 345 return false;
345 } 346 }
346 m_offSet += dwSize; 347 m_offSet += readSize;
347 pJpegModule->Input(m_pJpegContext, m_pSrcBuf, dwSize + dwAvail); 348 pJpegModule->Input(m_pJpegContext, m_pSrcBuf, readSize + dwAvail);
348 return true; 349 return true;
349 } 350 }
350 351
351 bool CCodec_ProgressiveDecoder::PngReadHeaderFunc(void* pModule, 352 bool CCodec_ProgressiveDecoder::PngReadHeaderFunc(void* pModule,
352 int width, 353 int width,
353 int height, 354 int height,
354 int bpc, 355 int bpc,
355 int pass, 356 int pass,
356 int* color_type, 357 int* color_type,
357 double* gamma) { 358 double* gamma) {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 } 606 }
606 } else { 607 } else {
607 uint32_t dwConsume = m_SrcSize - dwAvail; 608 uint32_t dwConsume = m_SrcSize - dwAvail;
608 if (dwAvail) { 609 if (dwAvail) {
609 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail); 610 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
610 } 611 }
611 if (dwSize > dwConsume) { 612 if (dwSize > dwConsume) {
612 dwSize = dwConsume; 613 dwSize = dwConsume;
613 } 614 }
614 } 615 }
615 if (!m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize)) { 616 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize);
617 if (readSize != dwSize && !m_pFile->IsEOF()) {
616 err_status = FXCODEC_STATUS_ERR_READ; 618 err_status = FXCODEC_STATUS_ERR_READ;
617 return false; 619 return false;
618 } 620 }
619 m_offSet += dwSize; 621 m_offSet += readSize;
620 pGifModule->Input(m_pGifContext, m_pSrcBuf, dwSize + dwAvail); 622 pGifModule->Input(m_pGifContext, m_pSrcBuf, readSize + dwAvail);
621 return true; 623 return true;
622 } 624 }
623 625
624 void CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback( 626 void CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback(
625 void* pModule, 627 void* pModule,
626 uint32_t& cur_pos) { 628 uint32_t& cur_pos) {
627 CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule; 629 CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
628 uint32_t remain_size = 630 uint32_t remain_size =
629 pCodec->m_pCodecMgr->GetGifModule()->GetAvailInput(pCodec->m_pGifContext); 631 pCodec->m_pCodecMgr->GetGifModule()->GetAvailInput(pCodec->m_pGifContext);
630 cur_pos = pCodec->m_offSet - remain_size; 632 cur_pos = pCodec->m_offSet - remain_size;
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 } 897 }
896 } else { 898 } else {
897 uint32_t dwConsume = m_SrcSize - dwAvail; 899 uint32_t dwConsume = m_SrcSize - dwAvail;
898 if (dwAvail) { 900 if (dwAvail) {
899 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail); 901 FXSYS_memmove(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
900 } 902 }
901 if (dwSize > dwConsume) { 903 if (dwSize > dwConsume) {
902 dwSize = dwConsume; 904 dwSize = dwConsume;
903 } 905 }
904 } 906 }
905 if (!m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize)) { 907 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf + dwAvail, m_offSet, dwSize);
908 if (readSize != dwSize && !m_pFile->IsEOF()) {
906 err_status = FXCODEC_STATUS_ERR_READ; 909 err_status = FXCODEC_STATUS_ERR_READ;
907 return false; 910 return false;
908 } 911 }
909 m_offSet += dwSize; 912 m_offSet += readSize;
910 pBmpModule->Input(m_pBmpContext, m_pSrcBuf, dwSize + dwAvail); 913 pBmpModule->Input(m_pBmpContext, m_pSrcBuf, readSize + dwAvail);
911 return true; 914 return true;
912 } 915 }
913 916
914 bool CCodec_ProgressiveDecoder::BmpInputImagePositionBufCallback( 917 bool CCodec_ProgressiveDecoder::BmpInputImagePositionBufCallback(
915 void* pModule, 918 void* pModule,
916 uint32_t rcd_pos) { 919 uint32_t rcd_pos) {
917 CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule; 920 CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
918 pCodec->m_offSet = rcd_pos; 921 pCodec->m_offSet = rcd_pos;
919 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERROR; 922 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERROR;
920 return pCodec->BmpReadMoreData(pCodec->m_pCodecMgr->GetBmpModule(), 923 return pCodec->BmpReadMoreData(pCodec->m_pCodecMgr->GetBmpModule(),
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 return false; 1060 return false;
1058 } 1061 }
1059 pBmpModule->InputImagePositionBufCallback = 1062 pBmpModule->InputImagePositionBufCallback =
1060 BmpInputImagePositionBufCallback; 1063 BmpInputImagePositionBufCallback;
1061 pBmpModule->ReadScanlineCallback = BmpReadScanlineCallback; 1064 pBmpModule->ReadScanlineCallback = BmpReadScanlineCallback;
1062 m_pBmpContext = pBmpModule->Start((void*)this); 1065 m_pBmpContext = pBmpModule->Start((void*)this);
1063 if (!m_pBmpContext) { 1066 if (!m_pBmpContext) {
1064 m_status = FXCODEC_STATUS_ERR_MEMORY; 1067 m_status = FXCODEC_STATUS_ERR_MEMORY;
1065 return false; 1068 return false;
1066 } 1069 }
1067 bool bResult = m_pFile->ReadBlock(m_pSrcBuf, 0, size); 1070 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, 0, size);
1068 if (!bResult) { 1071 if (readSize != size && !m_pFile->IsEOF()) {
1069 m_status = FXCODEC_STATUS_ERR_READ; 1072 m_status = FXCODEC_STATUS_ERR_READ;
1070 return false; 1073 return false;
1071 } 1074 }
1075 size = readSize;
1072 m_offSet += size; 1076 m_offSet += size;
1073 pBmpModule->Input(m_pBmpContext, m_pSrcBuf, size); 1077 pBmpModule->Input(m_pBmpContext, m_pSrcBuf, size);
1074 uint32_t* pPalette = nullptr; 1078 uint32_t* pPalette = nullptr;
1075 int32_t readResult = pBmpModule->ReadHeader( 1079 int32_t readResult = pBmpModule->ReadHeader(
1076 m_pBmpContext, &m_SrcWidth, &m_SrcHeight, &m_BmpIsTopBottom, 1080 m_pBmpContext, &m_SrcWidth, &m_SrcHeight, &m_BmpIsTopBottom,
1077 &m_SrcComponents, &m_SrcPaletteNumber, &pPalette, pAttribute); 1081 &m_SrcComponents, &m_SrcPaletteNumber, &pPalette, pAttribute);
1078 while (readResult == 2) { 1082 while (readResult == 2) {
1079 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT; 1083 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
1080 if (!BmpReadMoreData(pBmpModule, error_status)) { 1084 if (!BmpReadMoreData(pBmpModule, error_status)) {
1081 m_status = error_status; 1085 m_status = error_status;
(...skipping 27 matching lines...) Expand all
1109 CCodec_JpegModule* pJpegModule = m_pCodecMgr->GetJpegModule(); 1113 CCodec_JpegModule* pJpegModule = m_pCodecMgr->GetJpegModule();
1110 if (!pJpegModule) { 1114 if (!pJpegModule) {
1111 m_status = FXCODEC_STATUS_ERR_MEMORY; 1115 m_status = FXCODEC_STATUS_ERR_MEMORY;
1112 return false; 1116 return false;
1113 } 1117 }
1114 m_pJpegContext = pJpegModule->Start(); 1118 m_pJpegContext = pJpegModule->Start();
1115 if (!m_pJpegContext) { 1119 if (!m_pJpegContext) {
1116 m_status = FXCODEC_STATUS_ERR_MEMORY; 1120 m_status = FXCODEC_STATUS_ERR_MEMORY;
1117 return false; 1121 return false;
1118 } 1122 }
1119 bool bResult = m_pFile->ReadBlock(m_pSrcBuf, 0, size); 1123 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, 0, size);
1120 if (!bResult) { 1124 if (readSize != size && !m_pFile->IsEOF()) {
1121 m_status = FXCODEC_STATUS_ERR_READ; 1125 m_status = FXCODEC_STATUS_ERR_READ;
1122 return false; 1126 return false;
1123 } 1127 }
1128 size = readSize;
1124 m_offSet += size; 1129 m_offSet += size;
1125 pJpegModule->Input(m_pJpegContext, m_pSrcBuf, size); 1130 pJpegModule->Input(m_pJpegContext, m_pSrcBuf, size);
1126 int32_t readResult = 1131 int32_t readResult =
1127 pJpegModule->ReadHeader(m_pJpegContext, &m_SrcWidth, &m_SrcHeight, 1132 pJpegModule->ReadHeader(m_pJpegContext, &m_SrcWidth, &m_SrcHeight,
1128 &m_SrcComponents, pAttribute); 1133 &m_SrcComponents, pAttribute);
1129 while (readResult == 2) { 1134 while (readResult == 2) {
1130 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT; 1135 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
1131 if (!JpegReadMoreData(pJpegModule, error_status)) { 1136 if (!JpegReadMoreData(pJpegModule, error_status)) {
1132 m_status = error_status; 1137 m_status = error_status;
1133 return false; 1138 return false;
(...skipping 24 matching lines...) Expand all
1158 CCodec_ProgressiveDecoder::PngReadHeaderFunc; 1163 CCodec_ProgressiveDecoder::PngReadHeaderFunc;
1159 pPngModule->AskScanlineBufCallback = 1164 pPngModule->AskScanlineBufCallback =
1160 CCodec_ProgressiveDecoder::PngAskScanlineBufFunc; 1165 CCodec_ProgressiveDecoder::PngAskScanlineBufFunc;
1161 pPngModule->FillScanlineBufCompletedCallback = 1166 pPngModule->FillScanlineBufCompletedCallback =
1162 CCodec_ProgressiveDecoder::PngFillScanlineBufCompletedFunc; 1167 CCodec_ProgressiveDecoder::PngFillScanlineBufCompletedFunc;
1163 m_pPngContext = pPngModule->Start((void*)this); 1168 m_pPngContext = pPngModule->Start((void*)this);
1164 if (!m_pPngContext) { 1169 if (!m_pPngContext) {
1165 m_status = FXCODEC_STATUS_ERR_MEMORY; 1170 m_status = FXCODEC_STATUS_ERR_MEMORY;
1166 return false; 1171 return false;
1167 } 1172 }
1168 bool bResult = m_pFile->ReadBlock(m_pSrcBuf, 0, size); 1173 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, 0, size);
1169 if (!bResult) { 1174 if (readSize != size && !m_pFile->IsEOF()) {
1170 m_status = FXCODEC_STATUS_ERR_READ; 1175 m_status = FXCODEC_STATUS_ERR_READ;
1171 return false; 1176 return false;
1172 } 1177 }
1178 size = readSize;
1173 m_offSet += size; 1179 m_offSet += size;
1174 bResult = pPngModule->Input(m_pPngContext, m_pSrcBuf, size, pAttribute); 1180 bool bResult =
1181 pPngModule->Input(m_pPngContext, m_pSrcBuf, size, pAttribute);
1175 while (bResult) { 1182 while (bResult) {
1176 uint32_t remain_size = (uint32_t)m_pFile->GetSize() - m_offSet; 1183 uint32_t remain_size = (uint32_t)m_pFile->GetSize() - m_offSet;
1177 uint32_t input_size = 1184 uint32_t input_size =
1178 remain_size > FXCODEC_BLOCK_SIZE ? FXCODEC_BLOCK_SIZE : remain_size; 1185 remain_size > FXCODEC_BLOCK_SIZE ? FXCODEC_BLOCK_SIZE : remain_size;
1179 if (input_size == 0) { 1186 if (input_size == 0) {
1180 if (m_pPngContext) { 1187 if (m_pPngContext) {
1181 pPngModule->Finish(m_pPngContext); 1188 pPngModule->Finish(m_pPngContext);
1182 } 1189 }
1183 m_pPngContext = nullptr; 1190 m_pPngContext = nullptr;
1184 m_status = FXCODEC_STATUS_ERR_FORMAT; 1191 m_status = FXCODEC_STATUS_ERR_FORMAT;
1185 return false; 1192 return false;
1186 } 1193 }
1187 if (m_pSrcBuf && input_size > m_SrcSize) { 1194 if (m_pSrcBuf && input_size > m_SrcSize) {
1188 FX_Free(m_pSrcBuf); 1195 FX_Free(m_pSrcBuf);
1189 m_pSrcBuf = FX_Alloc(uint8_t, input_size); 1196 m_pSrcBuf = FX_Alloc(uint8_t, input_size);
1190 FXSYS_memset(m_pSrcBuf, 0, input_size); 1197 FXSYS_memset(m_pSrcBuf, 0, input_size);
1191 m_SrcSize = input_size; 1198 m_SrcSize = input_size;
1192 } 1199 }
1193 bResult = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size); 1200 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size);
1194 if (!bResult) { 1201 if (readSize != input_size && !m_pFile->IsEOF()) {
1195 m_status = FXCODEC_STATUS_ERR_READ; 1202 m_status = FXCODEC_STATUS_ERR_READ;
1196 return false; 1203 return false;
1197 } 1204 }
1198 m_offSet += input_size; 1205 m_offSet += readSize;
1199 bResult = 1206 bResult =
1200 pPngModule->Input(m_pPngContext, m_pSrcBuf, input_size, pAttribute); 1207 pPngModule->Input(m_pPngContext, m_pSrcBuf, readSize, pAttribute);
Tom Sepez 2016/11/16 18:32:01 I think we want to issue reads for the full size e
1201 } 1208 }
1202 ASSERT(!bResult); 1209 ASSERT(!bResult);
Tom Sepez 2016/11/16 18:32:00 This is the only use of bResult outside the loop,
1203 if (m_pPngContext) { 1210 if (m_pPngContext) {
1204 pPngModule->Finish(m_pPngContext); 1211 pPngModule->Finish(m_pPngContext);
1205 m_pPngContext = nullptr; 1212 m_pPngContext = nullptr;
1206 } 1213 }
1207 if (m_SrcPassNumber == 0) { 1214 if (m_SrcPassNumber == 0) {
1208 m_status = FXCODEC_STATUS_ERR_FORMAT; 1215 m_status = FXCODEC_STATUS_ERR_FORMAT;
1209 return false; 1216 return false;
1210 } 1217 }
1211 return true; 1218 return true;
1212 } 1219 }
1213 case FXCODEC_IMAGE_GIF: { 1220 case FXCODEC_IMAGE_GIF: {
1214 CCodec_GifModule* pGifModule = m_pCodecMgr->GetGifModule(); 1221 CCodec_GifModule* pGifModule = m_pCodecMgr->GetGifModule();
1215 if (!pGifModule) { 1222 if (!pGifModule) {
1216 m_status = FXCODEC_STATUS_ERR_MEMORY; 1223 m_status = FXCODEC_STATUS_ERR_MEMORY;
1217 return false; 1224 return false;
1218 } 1225 }
1219 pGifModule->RecordCurrentPositionCallback = 1226 pGifModule->RecordCurrentPositionCallback =
1220 CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback; 1227 CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback;
1221 pGifModule->AskLocalPaletteBufCallback = 1228 pGifModule->AskLocalPaletteBufCallback =
1222 CCodec_ProgressiveDecoder::GifAskLocalPaletteBufCallback; 1229 CCodec_ProgressiveDecoder::GifAskLocalPaletteBufCallback;
1223 pGifModule->InputRecordPositionBufCallback = 1230 pGifModule->InputRecordPositionBufCallback =
1224 CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback; 1231 CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback;
1225 pGifModule->ReadScanlineCallback = 1232 pGifModule->ReadScanlineCallback =
1226 CCodec_ProgressiveDecoder::GifReadScanlineCallback; 1233 CCodec_ProgressiveDecoder::GifReadScanlineCallback;
1227 m_pGifContext = pGifModule->Start((void*)this); 1234 m_pGifContext = pGifModule->Start((void*)this);
1228 if (!m_pGifContext) { 1235 if (!m_pGifContext) {
1229 m_status = FXCODEC_STATUS_ERR_MEMORY; 1236 m_status = FXCODEC_STATUS_ERR_MEMORY;
1230 return false; 1237 return false;
1231 } 1238 }
1232 bool bResult = m_pFile->ReadBlock(m_pSrcBuf, 0, size); 1239 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, 0, size);
1233 if (!bResult) { 1240 if (readSize != size && !m_pFile->IsEOF()) {
1234 m_status = FXCODEC_STATUS_ERR_READ; 1241 m_status = FXCODEC_STATUS_ERR_READ;
1235 return false; 1242 return false;
1236 } 1243 }
1244 size = readSize;
1237 m_offSet += size; 1245 m_offSet += size;
1238 pGifModule->Input(m_pGifContext, m_pSrcBuf, size); 1246 pGifModule->Input(m_pGifContext, m_pSrcBuf, size);
Tom Sepez 2016/11/16 18:32:00 Again, do we want a full block read here?
1239 m_SrcComponents = 1; 1247 m_SrcComponents = 1;
1240 int32_t readResult = pGifModule->ReadHeader( 1248 int32_t readResult = pGifModule->ReadHeader(
1241 m_pGifContext, &m_SrcWidth, &m_SrcHeight, &m_GifPltNumber, 1249 m_pGifContext, &m_SrcWidth, &m_SrcHeight, &m_GifPltNumber,
1242 (void**)&m_pGifPalette, &m_GifBgIndex, nullptr); 1250 (void**)&m_pGifPalette, &m_GifBgIndex, nullptr);
1243 while (readResult == 2) { 1251 while (readResult == 2) {
1244 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT; 1252 FXCODEC_STATUS error_status = FXCODEC_STATUS_ERR_FORMAT;
1245 if (!GifReadMoreData(pGifModule, error_status)) { 1253 if (!GifReadMoreData(pGifModule, error_status)) {
1246 m_status = error_status; 1254 m_status = error_status;
1247 return false; 1255 return false;
1248 } 1256 }
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 m_pFile = nullptr; 2138 m_pFile = nullptr;
2131 m_status = FXCODEC_STATUS_DECODE_FINISH; 2139 m_status = FXCODEC_STATUS_DECODE_FINISH;
2132 return m_status; 2140 return m_status;
2133 } 2141 }
2134 if (m_pSrcBuf && input_size > m_SrcSize) { 2142 if (m_pSrcBuf && input_size > m_SrcSize) {
2135 FX_Free(m_pSrcBuf); 2143 FX_Free(m_pSrcBuf);
2136 m_pSrcBuf = FX_Alloc(uint8_t, input_size); 2144 m_pSrcBuf = FX_Alloc(uint8_t, input_size);
2137 FXSYS_memset(m_pSrcBuf, 0, input_size); 2145 FXSYS_memset(m_pSrcBuf, 0, input_size);
2138 m_SrcSize = input_size; 2146 m_SrcSize = input_size;
2139 } 2147 }
2140 bool bResult = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size); 2148 uint32_t readSize = m_pFile->ReadBlock(m_pSrcBuf, m_offSet, input_size);
2141 if (!bResult) { 2149 if (readSize != input_size && !m_pFile->IsEOF()) {
2142 m_pDeviceBitmap = nullptr; 2150 m_pDeviceBitmap = nullptr;
2143 m_pFile = nullptr; 2151 m_pFile = nullptr;
2144 m_status = FXCODEC_STATUS_ERR_READ; 2152 m_status = FXCODEC_STATUS_ERR_READ;
2145 return m_status; 2153 return m_status;
2146 } 2154 }
2147 m_offSet += input_size; 2155 m_offSet += readSize;
2148 bResult = 2156 bool bResult =
Tom Sepez 2016/11/16 18:32:00 nit: local not needed.
2149 pPngModule->Input(m_pPngContext, m_pSrcBuf, input_size, nullptr); 2157 pPngModule->Input(m_pPngContext, m_pSrcBuf, readSize, nullptr);
2150 if (!bResult) { 2158 if (!bResult) {
2151 m_pDeviceBitmap = nullptr; 2159 m_pDeviceBitmap = nullptr;
2152 m_pFile = nullptr; 2160 m_pFile = nullptr;
2153 m_status = FXCODEC_STATUS_ERROR; 2161 m_status = FXCODEC_STATUS_ERROR;
2154 return m_status; 2162 return m_status;
2155 } 2163 }
2156 if (pPause && pPause->NeedToPauseNow()) { 2164 if (pPause && pPause->NeedToPauseNow()) {
2157 m_status = FXCODEC_STATUS_DECODE_TOBECONTINUE; 2165 m_status = FXCODEC_STATUS_DECODE_TOBECONTINUE;
2158 return m_status; 2166 return m_status;
2159 } 2167 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 return m_status; 2374 return m_status;
2367 } 2375 }
2368 default: 2376 default:
2369 return FXCODEC_STATUS_ERROR; 2377 return FXCODEC_STATUS_ERROR;
2370 } 2378 }
2371 } 2379 }
2372 2380
2373 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() { 2381 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() {
2374 return new CCodec_ProgressiveDecoder(this); 2382 return new CCodec_ProgressiveDecoder(this);
2375 } 2383 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698