[FFmpeg-devel] [PATCH] fix possible crash if vpre before vcodec
Fri Feb 27 13:06:48 CET 2009
On Fri, Feb 27, 2009 at 11:25:26AM +0100, Reimar D?ffinger wrote:
> I recently tried the following command
> ffmpeg -i baldursgate-logo.mve -vpre hq -vcodec libx264 -b 500k -an out.mp4
> and wondered why it would not work.
> strace showed the following:
> open("/home/reimar/.ffmpeg/hq.ffpreset", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/home/reimar/.ffmpeg/(null)-hq.ffpreset", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/local/share/ffmpeg/hq.ffpreset", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/local/share/ffmpeg/(null)-hq.ffpreset", O_RDONLY) = -1 ENOENT (No such file or directory)
> obviously ffmpeg tries to open the file already during option parsing (this could probably be considered
> the real bug). When -vcodec is set only afterwards it passes NULL to
> snprintf %s argument which may (and will) crash with some
> I propose a patch that at least avoids the crash, but e.g. this:
> -vcodec blub -vpre hq -vcodec libx264
> will still have the counter-intuitive behaviour of reading
> blub-hq.ffpreset but encoding with libx264.
would it not make more sense to warn the user that the codec is not set
before -*pre instead of silently skiping searching for the file?
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel