[Gdal-dev] Errors in dgnread.cpp

Steve Brooks sbrooks2 at kc.rr.com
Sat Sep 20 21:03:17 EDT 2003


Frank,

  Here is the dgn file.  Its not too big, but forgive me if 
I shouldn't have sent this to the list.

It's a pretty simple dgn file just contours and text.  The
error happens on the first element the (tcb).

Steve.


-----Original Message-----
From: gdal-dev-admin at remotesensing.org
[mailto:gdal-dev-admin at remotesensing.org] On Behalf Of Frank Warmerdam
Sent: Saturday, September 20, 2003 7:40 PM
To: gdal-dev at remotesensing.org
Cc: dgnlib
Subject: Re: [Gdal-dev] Errors in dgnread.cpp


Steve Brooks wrote:
> I have found two fatal errors in dgnread.cpp the first one will cause 
> a
> crash
> when there appears to be attributes on the tcb which inside the 'if'  
> psElement->attr_bytes gets setup as a negative number which causes the
> CPLMalloc to crash.  If you would like a copy of the dgn file let me 
> know. My fix was not to go inside the if( psElement->properties & 
> DGNPF_ATTRIBUTES ) if the element is a tcb.
>  
> The next change was causing OGRLayer::GetFeature
> to not return any features.  When the DGN Index was being built the 
> offset was being truncated to an invalid offest by the (unsigned char) 
> cast.
>  
> My envionment is Windows XP, Microsoft Visual Studio.Net 2003.

Steve,

I would appreciate a file to demonstrate the first problem.

The second is a very serious bug introduced in a fit of (apparently
improper) type casting fixes, and apparently breaks any random (rather than
sequential) index based element reads.

I have committed the fix for both but would still like to understand the
first issue better.

I am cc:ing the dgnlib list since it mostly effects people there, and I will
issue a new dgnlib within a couple days once I am happy with the fixes.

Best regards,
-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.dgn
Type: image/vnd.dgn
Size: 97280 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030920/ce433c07/test.bin


More information about the Gdal-dev mailing list