Look up the printer's port in the registry if neither CreateDC or
StartDoc specify one.
Photoshop 7 has a bug that results in cbInput being 2 less than the
length of the string rather than 2 more.  So use the WORD at
in_data[0] instead.

diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c
index 91e2c5d..d981900 100644
--- a/dlls/wineps/init.c
+++ b/dlls/wineps/init.c
@@ -299,9 +299,11 @@
     physDev->logPixelsX = physDev->pi->ppd->DefaultResolution;
     physDev->logPixelsY = physDev->pi->ppd->DefaultResolution;
 
-    if (!output) output = "LPT1:";  /* HACK */
-    physDev->job.output = HeapAlloc( PSDRV_Heap, 0, strlen(output)+1 );
-    strcpy( physDev->job.output, output );
+    if (output) {
+        physDev->job.output = HeapAlloc( PSDRV_Heap, 0, strlen(output)+1 );
+        strcpy( physDev->job.output, output );
+    } else
+        physDev->job.output = NULL;
     physDev->job.hJob = 0;
 
     if(initData) {
@@ -323,7 +325,8 @@
     TRACE("\n");
 
     HeapFree( PSDRV_Heap, 0, physDev->Devmode );
-    HeapFree( PSDRV_Heap, 0, physDev->job.output );
+    if(physDev->job.output)
+        HeapFree( PSDRV_Heap, 0, physDev->job.output );
     HeapFree( PSDRV_Heap, 0, physDev );
 
     return TRUE;