== Sequencer ==
authorPeter Schlaile <peter@schlaile.de>
Sun, 12 Oct 2008 12:00:26 +0000 (12:00 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 12 Oct 2008 12:00:26 +0000 (12:00 +0000)
This fixes (works around):
[#13598] LOAD / SAVE: Segfault after attempting to load surround encoded file

source/blender/src/hddaudio.c

index 506a9b1b8aa319189a940a8ee219a5c02aae7a5e..7e6b314f296396afe75fa981181f50d099a50338 100644 (file)
@@ -150,6 +150,15 @@ struct hdaudio * sound_open_hdaudio(char * filename)
                return 0;
        }
 
+       if (pCodecCtx->channels > 2) {
+               fprintf(stderr, "Sorry, audio file has too many channels."
+                       " Will fix in future, but resampler doesn't support "
+                       "this.\n");
+               avcodec_close(pCodecCtx);
+               av_close_input_file(pFormatCtx);
+               return 0;
+       }
+
        rval = (struct hdaudio *)MEM_mallocN(sizeof(struct hdaudio), 
                                             "hdaudio struct");