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
This commit is contained in:
Vincent Penquerc'h 2014-04-08 12:37:30 +01:00
parent e12646f30a
commit 57a138df86

View file

@ -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",