[FFmpeg-soc] [soc]: r3983 - wmapro/wma3dec.c

faust3 subversion at mplayerhq.hu
Sat Jan 17 19:11:52 CET 2009


Author: faust3
Date: Sat Jan 17 19:11:52 2009
New Revision: 3983

Log:
catch out of memory errors during default decorrelation matrix setup

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sat Jan 17 18:49:46 2009	(r3982)
+++ wmapro/wma3dec.c	Sat Jan 17 19:11:52 2009	(r3983)
@@ -328,13 +328,23 @@ static av_cold int wma3_decode_init(AVCo
     s->subwoofer_cutoff = s->subwoofer_cutoffs[0];
 
 
-    //FIXME
-    /** init stuff for the postprocxform */
+    /** set up decorrelation matrices */
     s->def_decorrelation_mat = av_mallocz(sizeof(int) * (s->nb_channels + 1));
+    if(!s->def_decorrelation_mat){
+        av_log(avctx, AV_LOG_ERROR, "failed to allocate decorrelation matrix\n");
+        wma3_decode_end(avctx);
+        return -1;
+    }
+
     s->def_decorrelation_mat[0] = 0;
     for(i=1;i<=s->nb_channels;i++){
         const float* tab = ff_wma3_default_decorrelation_matrices;
         s->def_decorrelation_mat[i] = av_mallocz(sizeof(float) * i);
+        if(!s->def_decorrelation_mat[i]){
+            av_log(avctx, AV_LOG_ERROR, "failed to setup decorrelation mat\n");
+            wma3_decode_end(avctx);
+            return -1;
+        }
         switch(i){
             case 1:
                 s->def_decorrelation_mat[i][0] = &tab[0];



More information about the FFmpeg-soc mailing list