Merge pull request #78 from atong-tcs/master
fix polyline memory corruption issue
This commit is contained in:
commit
186fd30b98
@ -753,9 +753,9 @@ void update_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER
|
||||
stream_read_uint8(s, polyline->cbData);
|
||||
|
||||
if (polyline->points == NULL)
|
||||
polyline->points = (DELTA_POINT*) xmalloc(polyline->cbData);
|
||||
polyline->points = (DELTA_POINT*) xmalloc(sizeof(DELTA_POINT) * polyline->numPoints);
|
||||
else
|
||||
polyline->points = (DELTA_POINT*) xrealloc(polyline->points, polyline->cbData);
|
||||
polyline->points = (DELTA_POINT*) xrealloc(polyline->points, sizeof(DELTA_POINT) * polyline->numPoints);
|
||||
|
||||
update_read_delta_points(s, polyline->points, polyline->numPoints, polyline->xStart, polyline->yStart);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user