Commit ace9ed32 authored by takis's avatar takis

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8553 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f79b2bf1
......@@ -36,7 +36,7 @@ const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mas
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment