|
From: | Felipe Sanches |
Subject: | Re: [libredwg] bugs |
Date: | Tue, 24 Nov 2015 12:38:50 -0200 |
Hi!in decode.c, macros DWG_ENTITY and DWG_OBJECT, line 231 and line 250 you havecalloc (sizeof (foo), 1) which should be calloc (1, sizeof (foo))in dwg.spec, function decode_3dsolid, line 1271/1272 you haveFIELD_VALUE(sat_data) = (BITCODE_RC**) realloc(FIELD_VALUE(sat_data), i * sizeof(BITCODE_RC*));FIELD_VALUE(block_size) = (BITCODE_BL*) realloc(FIELD_VALUE(block_size), i * sizeof(BITCODE_BL));the problem is in line 1256 you initialize i = 0 so the memory you are trying to write to after that is not valid. It should beFIELD_VALUE(sat_data) = (BITCODE_RC**) realloc(FIELD_VALUE(sat_data), (i+1) * sizeof(BITCODE_RC*));FIELD_VALUE(block_size) = (BITCODE_BL*) realloc(FIELD_VALUE(block_size), (i+1) * sizeof(BITCODE_BL));Keep up the good work!
[Prev in Thread] | Current Thread | [Next in Thread] |