The previous malloc fix was too large.

This commit is contained in:
Anthony Tong 2011-09-02 10:53:27 -04:00
parent 0742eb4ecb
commit 82e62778bc

View File

@ -751,11 +751,11 @@ void update_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
stream_read_uint8(s, polyline->cbData);
fprintf(stderr, "TONG %d %d %d\n", sizeof(DELTA_POINT*), polyline->cbData, polyline->numPoints);
if (polyline->points == NULL)
polyline->points = (DELTA_POINT*) xmalloc(sizeof(DELTA_POINT) * polyline->cbData);
polyline->points = (DELTA_POINT*) xmalloc(sizeof(DELTA_POINT) * polyline->numPoints);
else
polyline->points = (DELTA_POINT*) xrealloc(polyline->points, sizeof(DELTA_POINT) * 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);
}