summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-08 12:37:30 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-08 12:41:16 +0100
commit57a138df86d4f026299b9d12aba829b82d67aae6 (patch)
treef0c67018e66aa98b290ba59d1f12115624132b7c
parente12646f30a66e0d9f5586f5cb64963d728f081ca (diff)
downloadgstreamer-plugins-bad-57a138df86d4f026299b9d12aba829b82d67aae6.tar.gz
dtsdec: fix buffer overflows
Channels can be up to 7. Also add a guard in case more can be returned in the future. Coverity 1139820, 1139821
-rw-r--r--ext/dts/gstdtsdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c
index d92bf0569..a14d08fae 100644
--- a/ext/dts/gstdtsdec.c
+++ b/ext/dts/gstdtsdec.c
@@ -400,12 +400,12 @@ gst_dtsdec_renegotiate (GstDtsDec * dts)
{
gint channels;
gboolean result = FALSE;
- GstAudioChannelPosition from[6], to[6];
+ GstAudioChannelPosition from[7], to[7];
GstAudioInfo info;
channels = gst_dtsdec_channels (dts->using_channels, from);
- if (!channels)
+ if (channels <= 0 || channels > 7)
goto done;
GST_INFO_OBJECT (dts, "dtsdec renegotiate, channels=%d, rate=%d",