# HG changeset patch # User michael # Date 1206672284 0 # Node ID de03f6b32914d56d4691ca3d2d16a9bfc38fa3ea # Parent 4ebe80ca2a2decc22fcf7d9611d6253176c95592 1000l to myself, dereferencing uninitalized pointer. diff -r 4ebe80ca2a2d -r de03f6b32914 avidec.c --- a/avidec.c Thu Mar 27 20:58:01 2008 +0000 +++ b/avidec.c Fri Mar 28 02:44:44 2008 +0000 @@ -778,17 +778,17 @@ //parse ##dc/##wb if(n < s->nb_streams){ AVStream *st; - AVStream *st1 = s->streams[1]; - AVIStream *ast1= st1->priv_data; AVIStream *ast; st = s->streams[n]; ast = st->priv_data; + if(s->nb_streams>=2){ + AVStream *st1 = s->streams[1]; + AVIStream *ast1= st1->priv_data; //workaround for broken small-file-bug402.avi if( d[2] == 'w' && d[3] == 'b' && n==0 - && s->nb_streams>=2 && st ->codec->codec_type == CODEC_TYPE_VIDEO && st1->codec->codec_type == CODEC_TYPE_AUDIO && ast->prefix == 'd'*256+'c' @@ -799,6 +799,7 @@ ast = ast1; av_log(s, AV_LOG_WARNING, "Invalid stream+prefix combination, assuming audio\n"); } + } if( (st->discard >= AVDISCARD_DEFAULT && size==0)