Skip to content

Commit 9132354

Browse files
committed
Merge pull request opencv#9906 from sturkmen72:fix_grfmt_gdal
2 parents cca99bf + d1c5e79 commit 9132354

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/imgcodecs/src/grfmt_gdal.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,14 @@ ImageDecoder GdalDecoder::newDecoder()const{
562562
*/
563563
bool GdalDecoder::checkSignature( const String& signature )const{
564564

565-
566565
// look for NITF
567566
std::string str(signature);
568567
if( str.substr(0,4).find("NITF") != std::string::npos ){
569568
return true;
570569
}
571570

572571
// look for DTED
573-
if( str.substr(140,4) == "DTED" ){
572+
if( str.size() > 144 && str.substr(140,4) == "DTED" ){
574573
return true;
575574
}
576575

0 commit comments

Comments
 (0)