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

Unified Diff: core/fxcodec/codec/fx_codec_progress.cpp

Issue 2085493002: Fixup LoadImageInfo type checking. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_progress.cpp
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index 04ca7b26c214de5951f5851fceeab456afe5dfb9..3551fc272da9e29661f26bb6df9bec6f9a1e8fb5 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -1322,12 +1322,18 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::LoadImageInfo(
m_startX = m_startY = 0;
m_sizeX = m_sizeY = 0;
m_SrcPassNumber = 0;
- if (bSkipImageTypeCheck || (imageType != FXCODEC_IMAGE_UNKNOWN &&
- DetectImageType(imageType, pAttribute))) {
+ if (imageType != FXCODEC_IMAGE_UNKNOWN &&
+ DetectImageType(imageType, pAttribute)) {
m_imagType = imageType;
m_status = FXCODEC_STATUS_FRAME_READY;
return m_status;
}
+ // If we got here then the image data does not match the requested decoder.
+ // If we're skipping the type check then bail out at this point and return
+ // the failed status.
+ if (bSkipImageTypeCheck)
+ return m_status;
+
for (int type = FXCODEC_IMAGE_BMP; type < FXCODEC_IMAGE_MAX; type++) {
if (DetectImageType((FXCODEC_IMAGE_TYPE)type, pAttribute)) {
m_imagType = (FXCODEC_IMAGE_TYPE)type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698