From de9393c8b73c91cd0e0871e8e713edf95c8bc73b Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 4 Jun 2024 15:11:54 +0200 Subject: [PATCH] wineps.drv: Don't use dynamic buffer when writing new page info. --- dlls/wineps.drv/ps.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index 59e245b9b6c..149bfc81c36 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -526,19 +526,11 @@ INT PSDRV_WriteEndPage( print_ctx *ctx ) INT PSDRV_WriteNewPage( print_ctx *ctx ) { - char *buf; - char name[100]; signed int xtrans, ytrans, rotation; - int ret = 1; + char buf[256], name[16]; sprintf(name, "%d", ctx->job.PageNo); - buf = HeapAlloc( GetProcessHeap(), 0, sizeof(psnewpage) + 200 ); - if(!buf) { - WARN("HeapAlloc failed\n"); - return 0; - } - if(ctx->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) { if(ctx->pi->ppd->LandscapeOrientation == -90) { xtrans = GetDeviceCaps(ctx->hdc, PHYSICALHEIGHT) - @@ -564,10 +556,9 @@ INT PSDRV_WriteNewPage( print_ctx *ctx ) if( write_spool( ctx, buf, strlen(buf) ) != strlen(buf) ) { WARN("WriteSpool error\n"); - ret = 0; + return 0; } - HeapFree( GetProcessHeap(), 0, buf ); - return ret; + return 1; }