Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4767 closed defect (invalid)

Access Violations opening certain JPEG2000 images

Reported by: kellison Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.9.1
Severity: normal Keywords: JPEG2000 jp2 access violation
Cc:

Description

Using C# bindings, attempts to open certain JPEG2000 images results in access violations. Seems to be worse for larger images. Sample provided. Download info:

ftp://ftp.geocue.com/Outgoing/GdalAccessViolationTicket/GdalAccessViolation.jp2 ftp://ftp.geocue.com/Outgoing/GdalAccessViolationTicket/GdalAccessViolation.tfw

Login: geocueclient

Password: ZH66PjGB

This image also fails for me using gdalinfo.exe from a command prompt (Error signature ModName: libecwj2.dll). Even if this image is not up to spec, it would be nice if GDAL could detect and fail gracefully without an access violation which forces my application to exit. Some other non-gdal applications display this file fine. I am using the binaries downloaded from gisinternals. I have the following plugins:

07/12/2012 07:09 AM 89,088 gdal_BAG.dll

07/12/2012 07:10 AM 346,112 gdal_ECW_JP2ECW.dll

07/12/2012 07:10 AM 65,024 gdal_FITS.dll

07/12/2012 07:10 AM 156,160 gdal_GMT.dll

07/12/2012 07:09 AM 89,088 gdal_HDF5.dll

07/12/2012 07:09 AM 89,088 gdal_HDF5Image.dll

07/12/2012 07:09 AM 102,912 gdal_MrSID.dll

07/12/2012 07:10 AM 156,160 gdal_netCDF.dll

Change History (6)

comment:1 by Even Rouault, 10 years ago

Resolution: invalid
Status: newclosed

The binaries at gisinternal uses the ECW SDK 3.3, which is known to be buggy. There's nothing that GDAL can do to avoid crashes in it (I also reproduce the crash on Linux with ECW SDK 3.3)

I'd encourage you to use the GDAL that comes with OSGeo4W distribution. The ECW plugin uses the ECW SDK 4.2 now, and I've verified with a custom build of mine with ECW SDK 4.1, that there's no crash (but it is quite slow)

Closing as not a GDAL bug.

comment:2 by kellison, 10 years ago

Thanks for the clarification. Unfortunately, I find no C# bindings and no 64-bit distribution at OSGeo4W.

comment:3 by Even Rouault, 10 years ago

If you have a MSVC compiler available, you could start with the source SDK at gisinternal and replace the ECW SDK 3.3 with the ECW SDK 4.2. It is a matter of editing the gdal.opt file

in reply to:  2 ; comment:4 by tamas, 10 years ago

Replying to kellison:

Thanks for the clarification. Unfortunately, I find no C# bindings and no 64-bit distribution at OSGeo4W.

Did you experience this problem with the Win64 builds only, or with Win32 as well? Someone asked me to investigate such problem with the Win64 version, I wonder if you've run into the same problem.

ECW 4.x is not freely redistributable, so it cannot be included "officially".

in reply to:  4 comment:5 by kellison, 10 years ago

Replying to tamas:

Replying to kellison:

Thanks for the clarification. Unfortunately, I find no C# bindings and no 64-bit distribution at OSGeo4W.

Did you experience this problem with the Win64 builds only, or with Win32 as well? Someone asked me to investigate such problem with the Win64 version, I wonder if you've run into the same problem.

ECW 4.x is not freely redistributable, so it cannot be included "officially".

Saw same behavior on Win32 as Win64. I also had an image that would only partially display but would display completely in other applications. I tried rebuilding the plugins using instructions in the gisinternals SDK, but could not get it to build anything. I was wanting debug plugins, so I could step through the code in the debugger. I could not use the release plugins with a debug gdal19.dll.

comment:6 by Even Rouault, 10 years ago

Tamas: Note that in my case, it was with Linux 64bit. I don't have a 32bit handy with libecwj2. As far as the ECW 4.x is concerned, I believe that you could compile the GDAL ECW plugin against ECW 4.x headers and redistribute it only, and the user would have to download the ECW dll by themselves from the Erdas website.

Note: See TracTickets for help on using tickets.