[Ffmpeg-cvslog] r8553 - trunk/libavcodec/opt.c

takis subversion
Fri Mar 30 11:26:13 CEST 2007


Author: takis
Date: Fri Mar 30 11:26:13 2007
New Revision: 8553

Modified:
   trunk/libavcodec/opt.c

Log:
Fix a bug in av_find_opt(). Because some of the AVOption structures have field
unit = NULL, the function could pass NULL to strcmp and cause a segfault.

Patch by Kamil Nowosad, k nowosad % students mimuw edu pl.

Original thread:
Subject: [PATCH] small bugfix in av_find_opt()
Date: 03/23/2007 12:20 PM


Modified: trunk/libavcodec/opt.c
==============================================================================
--- trunk/libavcodec/opt.c	(original)
+++ trunk/libavcodec/opt.c	Fri Mar 30 11:26:13 2007
@@ -36,7 +36,7 @@ const AVOption *av_find_opt(void *v, con
     const AVOption *o= c->option;
 
     for(;o && o->name; o++){
-        if(!strcmp(o->name, name) && (!unit || !strcmp(o->unit, unit)) && (o->flags & mask) == flags )
+        if(!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && (o->flags & mask) == flags )
             return o;
     }
     return NULL;




More information about the ffmpeg-cvslog mailing list