Merge commit '0372e73f917e72c40b09270f771046fc142be4a7'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 17 Apr 2016 18:31:32 +0000 (19:31 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sun, 17 Apr 2016 18:31:32 +0000 (19:31 +0100)
* commit '0372e73f917e72c40b09270f771046fc142be4a7':
  intrax8: Check and propagate errors from ff_intrax8_common_init

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
1  2 
libavcodec/intrax8.c
libavcodec/intrax8.h

@@@ -738,25 -743,24 +742,29 @@@ static void x8_init_block_index(MpegEnc
      s->dest[2] += (s->mb_y & (~1)) * uvlinesize << 2;
  }
  
- av_cold void ff_intrax8_common_init(IntraX8Context *w, MpegEncContext *const s)
+ av_cold int ff_intrax8_common_init(IntraX8Context *w, MpegEncContext *const s)
  {
+     int ret = x8_vlc_init();
+     if (ret < 0)
+         return ret;
      w->s = s;
-     x8_vlc_init();
-     av_assert0(s->mb_width > 0);
  
 -    // two rows, 2 blocks per cannon mb
 +    //two rows, 2 blocks per cannon mb
      w->prediction_table = av_mallocz(s->mb_width * 2 * 2);
+     if (!w->prediction_table)
+         return AVERROR(ENOMEM);
  
 -    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[0],
 +    ff_wmv2dsp_init(&w->wdsp);
 +
 +    ff_init_scantable_permutation(w->idct_permutation,
 +                                  w->wdsp.idct_perm);
 +
 +    ff_init_scantable(w->idct_permutation, &w->scantable[0],
                        ff_wmv1_scantable[0]);
 -    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[1],
 +    ff_init_scantable(w->idct_permutation, &w->scantable[1],
                        ff_wmv1_scantable[2]);
 -    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[2],
 +    ff_init_scantable(w->idct_permutation, &w->scantable[2],
                        ff_wmv1_scantable[3]);
  
      ff_intrax8dsp_init(&w->dsp);
Simple merge