Opened 8 years ago

Closed 8 years ago

Last modified 9 months ago

#3162 closed enhancement (invalid)

Fixes and patches for libecwj2

Reported by: Mateusz Łoskot Owned by: Mateusz Łoskot
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: libecwj, libecwj2, ecw, 32-bit, 64-bit
Cc:

Description (last modified by warmerdam)

The purpose of this ticket is to archive patches and improvements to libecwj2 library

It should provide GDAL users with help in building libecwj2 binaries from source using various recent compilers like

  • Microsoft Visual C++ 9.0+
  • GCC 4.x+

for 32-bit and 64-bit architectures.

The patches mainly target sources of libecwj2-3.3.

Related tickets:

  • #2032 - Building with ECW support on Mac OS X
  • #1347 - Current CVS doesn't build using ECW support with GCC 4.1
  • MS 3245 - large virtual memory leak opening and closing many ecw files.

Related discussions:

Please, report problems as comments below and feel free to attach patches. Hopefully, the libecwj developer will find all this information useful.

Attachments (1)

libecwj2-3.3-msvc90-fixes.patch (9.8 KB) - added by Mateusz Łoskot 8 years ago.
Patch with fixes made against source of libecwj2-3.3-2006-09-06 required to build it using Visual C++ 9.0 on 32 and 64 bit arch.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Mateusz Łoskot

Patch with fixes made against source of libecwj2-3.3-2006-09-06 required to build it using Visual C++ 9.0 on 32 and 64 bit arch.

comment:1 Changed 8 years ago by Mateusz Łoskot

Keywords: 32-bit 64-bit added

comment:2 Changed 8 years ago by Mateusz Łoskot

Owner: changed from warmerdam to Mateusz Łoskot
Status: newassigned

comment:3 Changed 8 years ago by warmerdam

Resolution: invalid
Status: assignedclosed

This isn't actually a ticket about GDAL so I'm disinclined to treat it as an open issue. It may be extended of course with additional material to help those building the ecw libraries, but I feel this material really belongs off:

http://trac.osgeo.org/gdal/wiki/ECW

comment:4 Changed 8 years ago by Mateusz Łoskot

OK

comment:5 Changed 8 years ago by warmerdam

Description: modified (diff)

comment:6 Changed 9 months ago by Even Rouault

An additional patch was found to be needed on recent Ubuntu (16.04) to fix a crash when tinyxml attempts to open a directory with fopen(), which succeeds, but seeking to end of file and getting the offset returns the value -1 cast a UINT64_MAX, which cause a later crash in a memory allocation

Fixed with:

diff -ur libecwj2-3.3-2006-09-06/Source/C/tinyxml/tinyxml.cpp libecwj2-3.3/Source/C/tinyxml/tinyxml.cpp
--- libecwj2-3.3-2006-09-06/Source/C/tinyxml/tinyxml.cpp	2006-07-03 03:15:12.000000000 +0200
+++ libecwj2-3.3/Source/C/tinyxml/tinyxml.cpp	2016-12-16 23:34:26.141000205 +0100
@@ -983,7 +983,7 @@
 		fseek( file, 0, SEEK_SET );
 
 		// Strange case, but good to handle up front.
-		if ( length == 0 )
+		if ( length <= 0 || length > INT_MAX )
 		{
 			fclose( file );
 			return false;

Cumulative patch created at https://trac.osgeo.org/gdal/attachment/wiki/ECW/libecwj2-3.3.patch

Note: See TracTickets for help on using tickets.