Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp |
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp |
index e68fcb6800a30792db44dc2ec3f56e96c260a882..18233c764a61c9bd0a32ec01d413adfd431bb118 100644 |
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp |
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp |
@@ -362,7 +362,7 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf, |
// Use ToDictionary here because we can push NULL into the ParamList. |
CPDF_Dictionary* pParam = |
ToDictionary(static_cast<CPDF_Object*>(ParamList[i])); |
- uint8_t* new_buf = NULL; |
+ uint8_t* new_buf = nullptr; |
FX_DWORD new_size = (FX_DWORD)-1; |
int offset = -1; |
if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) { |
@@ -394,19 +394,21 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf, |
return TRUE; |
} |
offset = RunLengthDecode(last_buf, last_size, new_buf, new_size); |
- } else { |
+ } else if (i == DecoderList.GetSize() - 1) { |
jun_fang
2015/11/09 11:09:35
It's too strict checking here.
The filters DCT(JP
Oliver Chang
2015/11/09 20:41:22
Apologies if I misunderstood something, but why is
jun_fang
2015/11/11 10:10:36
- The previous behavior is: all valid or invalid d
jun_fang
2015/11/11 10:13:39
I don't have the permission to access the test fil
Oliver Chang
2015/11/11 17:25:19
Thanks for the clarification!
I see, so we still
|
+ // Check if this is an image decoder. |
if (decoder == FX_BSTRC("DCT")) { |
decoder = "DCTDecode"; |
} else if (decoder == FX_BSTRC("CCF")) { |
decoder = "CCITTFaxDecode"; |
- } else if (decoder == FX_BSTRC("Crypt")) { |
- continue; |
} |
ImageEncoding = decoder; |
pImageParms = pParam; |
dest_buf = (uint8_t*)last_buf; |
dest_size = last_size; |
return TRUE; |
+ } else { |
+ // Ignore all other decoders. |
+ continue; |
} |
if (last_buf != src_buf) { |
FX_Free(last_buf); |
@@ -419,7 +421,7 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf, |
last_size = new_size; |
} |
ImageEncoding = ""; |
- pImageParms = NULL; |
+ pImageParms = nullptr; |
dest_buf = last_buf; |
dest_size = last_size; |
return TRUE; |