mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-06-12 15:37:14 +02:00
Avoid NULL pointer dereference in coders/wmf.c (#5117)
This commit is contained in:
+20
-17
@@ -1223,24 +1223,27 @@ static void ipa_draw_polypolygon(wmfAPI * API, wmfPolyPoly_t* polypolygon)
|
||||
util_set_brush(API, polypolygon->dc, BrushApplyFill);
|
||||
|
||||
DrawPathStart(WmfDrawingWand);
|
||||
for (polygon = 0; polygon < polypolygon->npoly; polygon++)
|
||||
if (polypolygon->pt && polypolygon->count)
|
||||
{
|
||||
polyline.dc = polypolygon->dc;
|
||||
polyline.pt = polypolygon->pt[polygon];
|
||||
polyline.count = polypolygon->count[polygon];
|
||||
if ((polyline.count > 2) && polyline.pt)
|
||||
{
|
||||
DrawPathMoveToAbsolute(WmfDrawingWand,
|
||||
XC(polyline.pt[0].x),
|
||||
YC(polyline.pt[0].y));
|
||||
for (point = 1; point < polyline.count; point++)
|
||||
{
|
||||
DrawPathLineToAbsolute(WmfDrawingWand,
|
||||
XC(polyline.pt[point].x),
|
||||
YC(polyline.pt[point].y));
|
||||
}
|
||||
DrawPathClose(WmfDrawingWand);
|
||||
}
|
||||
for (polygon = 0; polygon < polypolygon->npoly; polygon++)
|
||||
{
|
||||
polyline.dc = polypolygon->dc;
|
||||
polyline.pt = polypolygon->pt[polygon];
|
||||
polyline.count = polypolygon->count[polygon];
|
||||
if ((polyline.count > 2) && polyline.pt)
|
||||
{
|
||||
DrawPathMoveToAbsolute(WmfDrawingWand,
|
||||
XC(polyline.pt[0].x),
|
||||
YC(polyline.pt[0].y));
|
||||
for (point = 1; point < polyline.count; point++)
|
||||
{
|
||||
DrawPathLineToAbsolute(WmfDrawingWand,
|
||||
XC(polyline.pt[point].x),
|
||||
YC(polyline.pt[point].y));
|
||||
}
|
||||
DrawPathClose(WmfDrawingWand);
|
||||
}
|
||||
}
|
||||
}
|
||||
DrawPathFinish(WmfDrawingWand);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user