diff --git a/coders/pict.c b/coders/pict.c
index 65535a8..969759f 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -1352,7 +1352,7 @@
         file=(FILE *) NULL;
         unique_file=AcquireUniqueFileResource(read_info->filename);
         if (unique_file != -1)
-          file=OpenMagickStream(read_info->filename,"wb");
+          file=fdopen(unique_file,"wb");
         if ((unique_file == -1) || (file == (FILE *) NULL))
           {
             (void) CopyMagickString(image->filename,read_info->filename,