From 3110f63162b3194c0fd059f8e8cd2096cb97df74 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 12 Oct 2008 12:00:26 +0000 Subject: [PATCH] == Sequencer == This fixes (works around): [#13598] LOAD / SAVE: Segfault after attempting to load surround encoded file --- source/blender/src/hddaudio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c index 506a9b1b8aa..7e6b314f296 100644 --- a/source/blender/src/hddaudio.c +++ b/source/blender/src/hddaudio.c @@ -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");