Merge commit '8f558c3e101859aec9adcb4b4b270ae1ef8f88b5' into release/1.1
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 12 May 2013 11:35:30 +0000 (13:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 12 May 2013 11:35:30 +0000 (13:35 +0200)
* commit '8f558c3e101859aec9adcb4b4b270ae1ef8f88b5':
  af_channelmap: sanity check input channel indices in all cases.
  id3v2: pad the APIC packets as required by lavc.
  lavf: make sure stream probe data gets freed.
  dfa: check for invalid access in decode_wdlt().

Conflicts:
libavformat/id3v2.c
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/dfa.c
libavfilter/af_channelmap.c
libavformat/id3v2.c
libavformat/utils.c

Simple merge
Simple merge
@@@ -490,9 -477,10 +490,10 @@@ static void read_apic(AVFormatContext *
      }
  
      apic->len   = taglen;
-     apic->data  = av_malloc(taglen);
+     apic->data  = av_malloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
 -    if (!apic->data || avio_read(pb, apic->data, taglen) != taglen)
 +    if (!apic->data || !apic->len || avio_read(pb, apic->data, taglen) != taglen)
          goto fail;
+     memset(apic->data + taglen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
  
      new_extra->tag    = "APIC";
      new_extra->data   = apic;
@@@ -3167,26 -2653,6 +3167,26 @@@ int av_read_pause(AVFormatContext *s
      return AVERROR(ENOSYS);
  }
  
-     av_freep(&st->probe_data.buf);
 +void ff_free_stream(AVFormatContext *s, AVStream *st){
 +    av_assert0(s->nb_streams>0);
 +    av_assert0(s->streams[ s->nb_streams-1 ] == st);
 +
 +    if (st->parser) {
 +        av_parser_close(st->parser);
 +    }
 +    if (st->attached_pic.data)
 +        av_free_packet(&st->attached_pic);
 +    av_dict_free(&st->metadata);
++    av_freep(&st->probe_data.buf);
 +    av_freep(&st->index_entries);
 +    av_freep(&st->codec->extradata);
 +    av_freep(&st->codec->subtitle_header);
 +    av_freep(&st->codec);
 +    av_freep(&st->priv_data);
 +    av_freep(&st->info);
 +    av_freep(&s->streams[ --s->nb_streams ]);
 +}
 +
  void avformat_free_context(AVFormatContext *s)
  {
      int i;