Chromium Code Reviews| Index: core/src/fxcodec/codec/fx_codec_jpx_opj.cpp |
| diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp |
| index 4494244410854eb4f86c30fc547747d932191ce4..1a7e541075c9b37826e07c676b05f7c2b208041e 100644 |
| --- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp |
| +++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp |
| @@ -596,7 +596,7 @@ FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size) |
| opj_set_default_decoder_parameters(¶meters); |
| parameters.decod_format = 0; |
| parameters.cod_format = 3; |
| - if(FXSYS_memcmp32(m_SrcData, "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", 12) == 0) { |
| + if(m_SrcSize >= 12 && FXSYS_memcmp32(m_SrcData, "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", 12) == 0) { |
|
jun_fang
2014/08/26 21:48:09
1. Define an array to save the string "\x00\x00\x0
|
| l_codec = opj_create_decompress(OPJ_CODEC_JP2); |
| parameters.decod_format = 1; |
| } else { |