[MPlayer-dev-eng] [PATCH] mencoder psnr segfaults on readonly fs

Fabio Russo f.russo at sosinformatica.com
Thu Mar 11 16:43:49 CET 2004


Hi,
after trying to execute mencoder in a read only fs (or, better, when the
user hasn't the write permissions) with the psnr option, it actually
segfaults when trying to fprintf on psnr.log. Attached is a simple fix
that will call mp_msg and let mencoder continue his job.
The same problem should happen in ve_xvid.c, ve_xvid4.c and vd_ffmpeg.c
(none of them tested), so maybe a more elegant solution should be
adopted.
Time for a question: should mencoder stop its execution if it can't
write to the log file? If you are encoding only for testing and after
some time you _don't_ have the log...
-- 
Kind regards,
Fabio Russo

f.russo at sosinformatica.com
-------------- next part --------------
--- main/libmpcodecs/ve_lavc.c.orig	2004-03-11 03:22:31.900002144 +0100
+++ main/libmpcodecs/ve_lavc.c	2004-03-11 03:23:46.085724200 +0100
@@ -774,6 +774,8 @@
             if(!fvstats) {
                 perror("fopen");
                 lavc_param_psnr=0; // disable block
+                mp_msg(MSGT_MENCODER,MSGL_ERR,"Can't open %s for writing. Check your permissions.\n",filename);
+                return 0; 
                 /*exit(1);*/
             }
         }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio ? firmata
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040311/175880ea/attachment.pgp>


More information about the MPlayer-dev-eng mailing list