aac: Don't attempt to output configure an invalid channel configuration.
authorAlex Converse <alex.converse@gmail.com>
Fri, 5 Aug 2011 19:40:51 +0000 (12:40 -0700)
committerAlex Converse <alex.converse@gmail.com>
Tue, 9 Aug 2011 19:16:40 +0000 (12:16 -0700)
libavcodec/aacdec.c

index 5740d6cd71307d8247be7c15db83b24b85e6b23f..0cae1550fabbd63437a0bfe3c0aa213ba560f93b 100644 (file)
@@ -589,10 +589,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
         ac->m4ac.chan_config = i;
 
         if (ac->m4ac.chan_config) {
         ac->m4ac.chan_config = i;
 
         if (ac->m4ac.chan_config) {
-            if (set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config) < 0 &&
-                avctx->error_recognition >= FF_ER_EXPLODE)
-              return AVERROR_INVALIDDATA;
-            output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
+            int ret = set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
+            if (!ret)
+                output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
+            else if (avctx->error_recognition >= FF_ER_EXPLODE)
+                return AVERROR_INVALIDDATA;
         }
     }
 
         }
     }