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:
parent
e12646f30a
commit
57a138df86
@ -400,12 +400,12 @@ gst_dtsdec_renegotiate (GstDtsDec * dts)
|
|||||||
{
|
{
|
||||||
gint channels;
|
gint channels;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
GstAudioChannelPosition from[6], to[6];
|
GstAudioChannelPosition from[7], to[7];
|
||||||
GstAudioInfo info;
|
GstAudioInfo info;
|
||||||
|
|
||||||
channels = gst_dtsdec_channels (dts->using_channels, from);
|
channels = gst_dtsdec_channels (dts->using_channels, from);
|
||||||
|
|
||||||
if (!channels)
|
if (channels <= 0 || channels > 7)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
GST_INFO_OBJECT (dts, "dtsdec renegotiate, channels=%d, rate=%d",
|
GST_INFO_OBJECT (dts, "dtsdec renegotiate, channels=%d, rate=%d",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user