From d1c5e79ec324fb2c2edefb4d8c6d46a3db01e629 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Sun, 22 Oct 2017 19:01:34 +0300 Subject: [PATCH] Update grfmt_gdal.cpp --- modules/imgcodecs/src/grfmt_gdal.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/imgcodecs/src/grfmt_gdal.cpp b/modules/imgcodecs/src/grfmt_gdal.cpp index 4bb8dd0..7953256 100644 --- a/modules/imgcodecs/src/grfmt_gdal.cpp +++ b/modules/imgcodecs/src/grfmt_gdal.cpp @@ -562,7 +562,6 @@ ImageDecoder GdalDecoder::newDecoder()const{ */ bool GdalDecoder::checkSignature( const String& signature )const{ - // look for NITF std::string str(signature); if( str.substr(0,4).find("NITF") != std::string::npos ){ @@ -570,7 +569,7 @@ bool GdalDecoder::checkSignature( const String& signature )const{ } // look for DTED - if( str.substr(140,4) == "DTED" ){ + if( str.size() > 144 && str.substr(140,4) == "DTED" ){ return true; } -- 2.7.4