# HG changeset patch # User takis # Date 1175246773 0 # Node ID c6a2b573f2598ac8343f911ff48ee7405a33e4a9 # Parent 66aff3b71861e7eba3c1c831c0b2486dabf76894 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 diff -r 66aff3b71861 -r c6a2b573f259 opt.c --- a/opt.c Fri Mar 30 09:05:52 2007 +0000 +++ b/opt.c Fri Mar 30 09:26:13 2007 +0000 @@ -36,7 +36,7 @@ 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;