summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/libav/gstavcodecmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
index 92a17fc..9cb23d9 100644
--- a/ext/libav/gstavcodecmap.c
+++ b/ext/libav/gstavcodecmap.c
@@ -124,7 +124,7 @@ gst_ffmpeg_channel_layout_to_gst (guint64 channel_layout, gint channels,
guint nchannels = 0;
gboolean none_layout = FALSE;
- if (channel_layout == 0) {
+ if (channel_layout == 0 || channels > 64) {
nchannels = channels;
none_layout = TRUE;
} else {
@@ -185,7 +185,7 @@ gst_ffmpeg_channel_layout_to_gst (guint64 channel_layout, gint channels,
} else {
guint i;
- for (i = 0; i < nchannels; i++)
+ for (i = 0; i < nchannels && i < 64; i++)
pos[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
}
}