Opened 13 years ago

Closed 13 years ago

Last modified 6 years 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

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 13 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)

by Mateusz Łoskot, 13 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.

comment:1 by Mateusz Łoskot, 13 years ago

Keywords: 32-bit 64-bit added

comment:2 by Mateusz Łoskot, 13 years ago

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

comment:3 by warmerdam, 13 years ago

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:

comment:4 by Mateusz Łoskot, 13 years ago


comment:5 by warmerdam, 13 years ago

Description: modified (diff)

comment:6 by Even Rouault, 6 years ago

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

Note: See TracTickets for help on using tickets.