Signed-off-by: Shawn M. Chapla schapla@codeweavers.com --- dlls/gdi32/enhmetafile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index fc3389ff23f..4d6531644b9 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -1622,9 +1622,12 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_POLYDRAW: { const EMRPOLYDRAW *lpPolyDraw = (const EMRPOLYDRAW *)mr; + + /* NB abTypes array doesn't start at lpPolyDraw->abTypes. It's actually + lpPolyDraw->aptl + lpPolyDraw->cptl. */ PolyDraw( hdc, (const POINT*)lpPolyDraw->aptl, - lpPolyDraw->abTypes, + (BYTE*)(lpPolyDraw->aptl + lpPolyDraw->cptl), (INT)lpPolyDraw->cptl );
break;
Signed-off-by: Shawn M. Chapla schapla@codeweavers.com --- dlls/gdi32/enhmetafile.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index 4d6531644b9..666828db1f4 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -1143,6 +1143,31 @@ BOOL WINAPI PlayEnhMetaFileRecord( break; }
+ case EMR_POLYDRAW16: + { + const EMRPOLYDRAW16 *pPolyDraw16 = (const EMRPOLYDRAW16 *)mr; + const POINTS *ptl = pPolyDraw16->apts; + POINT *pts = HeapAlloc(GetProcessHeap(), 0, pPolyDraw16->cpts * sizeof(POINT)); + DWORD i; + + /* NB abTypes array doesn't start at pPolyDraw16->abTypes. It's actually + pPolyDraw16->apts + pPolyDraw16->cpts. */ + const BYTE *types = (BYTE*)(pPolyDraw16->apts + pPolyDraw16->cpts); + + if (!pts) + break; + + for (i = 0; i < pPolyDraw16->cpts; ++i) + { + pts[i].x = ptl[i].x; + pts[i].y = ptl[i].y; + } + + PolyDraw(hdc, pts, types, pPolyDraw16->cpts); + HeapFree(GetProcessHeap(), 0, pts); + break; + } + case EMR_STRETCHDIBITS: { const EMRSTRETCHDIBITS *pStretchDIBits = (const EMRSTRETCHDIBITS *)mr; @@ -2243,7 +2268,6 @@ BOOL WINAPI PlayEnhMetaFileRecord( break; }
- case EMR_POLYDRAW16: case EMR_GLSRECORD: case EMR_GLSBOUNDEDRECORD: case EMR_DRAWESCAPE:
Signed-off-by: Huw Davies huw@codeweavers.com