Revision 41757171

View differences:

libavformat/avidec.c
778 778
        //parse ##dc/##wb
779 779
        if(n < s->nb_streams){
780 780
          AVStream *st;
781
          AVStream *st1  = s->streams[1];
782
          AVIStream *ast1= st1->priv_data;
781 783
          AVIStream *ast;
782 784
          st = s->streams[n];
783 785
          ast = st->priv_data;
784 786

  
787

  
788
            //workaround for broken small-file-bug402.avi
789
            if(   d[2] == 'w' && d[3] == 'b'
790
               && n==0
791
               && s->nb_streams>=2
792
               && st ->codec->codec_type == CODEC_TYPE_VIDEO
793
               && st1->codec->codec_type == CODEC_TYPE_AUDIO
794
               && ast->prefix == 'd'*256+'c'
795
               && (d[2]*256+d[3] == ast1->prefix || !ast1->prefix_count)
796
              ){
797
                n=1;
798
                st = st1;
799
                ast = ast1;
800
                av_log(s, AV_LOG_WARNING, "Invalid stream+prefix combination, assuming audio\n");
801
            }
802

  
803

  
785 804
          if(   (st->discard >= AVDISCARD_DEFAULT && size==0)
786 805
             /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering
787 806
             || st->discard >= AVDISCARD_ALL){

Also available in: Unified diff