Commit 2e242de3 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/ffmpeg.c: avoid a strcmp() in LibavcodecCallback().

parent d1d351f8
......@@ -338,13 +338,16 @@ static void LibavcodecCallback( void *p_opaque, int i_level,
p_avc = p_avctx ? p_avctx->av_class : 0;
#define cln p_avc->class_name
/* Make sure we can get p_this back */
if( !p_avctx || !p_avc || !p_avc->class_name ||
strcmp( p_avc->class_name, "AVCodecContext" ) )
if( !p_avctx || !p_avc || !cln ||
cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' ||
cln[4]!='d' || cln[5]!='e' || cln[6]!='c' )
{
if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va );
return;
}
#undef cln
p_this = (vlc_object_t *)p_avctx->opaque;
......
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