Merge commit '44079902c49e526f464bb4eb855665e1af867e91' into release/1.1
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 05:17:49 +0000 (06:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 05:23:46 +0000 (06:23 +0100)
* commit '44079902c49e526f464bb4eb855665e1af867e91':
  mov: Free intermediate arrays in the normal cleanup function
  segafilm: fix leaks if reading the header fails
  h264_cavlc: check the size of the intra PCM data.
  h263: Check init_get_bits return value
  cavsdec: check ff_get_buffer() return value

Conflicts:
libavcodec/cavsdec.c
libavcodec/h263dec.c
libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/cavsdec.c
libavcodec/h263dec.c
libavcodec/h264_cavlc.c
libavformat/mov.c
libavformat/segafilm.c

Simple merge
@@@ -392,31 -384,20 +392,34 @@@ uint64_t time= rdtsc()
              return buf_size;
      }
  
 +retry:
 +    if(s->divx_packed && s->bitstream_buffer_size){
 +        int i;
 +        for(i=0; i<buf_size-3; i++){
 +            if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
 +                if(buf[i+3]==0xB0){
 +                    av_log(s->avctx, AV_LOG_WARNING, "Discarding excessive bitstream in packed xvid\n");
 +                    s->bitstream_buffer_size=0;
 +                }
 +                break;
 +            }
 +        }
 +    }
 +
-     if(s->bitstream_buffer_size && (s->divx_packed || buf_size<20)){ //divx 5.01+/xvid frame reorder
-         init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8);
-     }else
-         init_get_bits(&s->gb, buf, buf_size*8);
+     if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder
+         ret = init_get_bits8(&s->gb, s->bitstream_buffer,
+                              s->bitstream_buffer_size);
+     else
+         ret = init_get_bits8(&s->gb, buf, buf_size);
 -    s->bitstream_buffer_size = 0;
 +    s->bitstream_buffer_size=0;
+     if (ret < 0)
+         return ret;
  
-     if (!s->context_initialized) {
-         if ((ret = ff_MPV_common_init(s)) < 0) //we need the idct permutaton for reading a custom matrix
+     if (!s->context_initialized)
+         // we need the idct permutaton for reading a custom matrix
+         if ((ret = ff_MPV_common_init(s)) < 0)
              return ret;
-     }
  
      /* We need to set current_picture_ptr before reading the header,
       * otherwise we cannot store anyting in there */
Simple merge
@@@ -3089,13 -2758,14 +3089,15 @@@ static int mov_read_close(AVFormatConte
          av_freep(&sc->drefs);
          if (sc->pb && sc->pb != s->pb)
              avio_close(sc->pb);
 +        sc->pb = NULL;
          av_freep(&sc->chunk_offsets);
-         av_freep(&sc->keyframes);
-         av_freep(&sc->sample_sizes);
-         av_freep(&sc->stps_data);
          av_freep(&sc->stsc_data);
+         av_freep(&sc->sample_sizes);
+         av_freep(&sc->keyframes);
          av_freep(&sc->stts_data);
+         av_freep(&sc->stps_data);
+         av_freep(&sc->rap_group);
      }
  
      if (mov->dv_demux) {
Simple merge