[FFmpeg-devel] [PATCH] parse_options(): Avoid passing NULL as a string arg to fprintf

Michael Niedermayer michaelni at gmx.at
Fri Jun 24 04:48:29 CEST 2011

On Thu, Jun 23, 2011 at 02:57:45PM -0400, Jeff Downs wrote:
> I recently restored FATE testing on SPARC/Solaris.  One test is presently 
> failing, where ffmpeg crashes when given the argument -pix_fmts.
> The crash occurs due to arg being NULL in the fprintf mentioned in the 
> patch below.  The patch fixes the specific symptom, and seems to be a 
> good idea anyway as in the general case it appears that arg can be NULL.  

i agree, the patch LGTM

> However this doesn't fix the underlying problem that when processing 
> -pix_fmts (and others like it), the error case is being executed to begin 
> with.
> This is because several of the arg processing functions, the one for 
> -pix_fmts included, are accessed via function pointer int (*fp)(const char 
> *, const char *) but, in reality, are functions declared & implemented as 
> void f(void).
> On sparc, executing these with the expectation of returning int does not 
> yield a 0 return (as it apparently does on other platforms).

this bug sounds related to eb8bc57240d5d3e4680ff1df18a0a7792e96bd0c

> I was going to send patches to fix this, too, but that would require 
> changing all the arg processing functions to match the pointer signature 
> and thought that it best to put the problem out there and collect any 
> comments/input before working on such a large change.
> Note that most of the problematic functions would have to be changed to 
> both take args (where they don't presently, and hence the args would be 
> dummy) and to return a value (fixed 0) to fix this to be "proper". Input 
> welcome.

ill be happy with whatever you and stefano agree to

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110624/9f59241a/attachment.asc>

More information about the ffmpeg-devel mailing list