diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-01-20 17:02:15 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-01-20 17:10:48 +0100 |
commit | a3ea25bc8829fd6d859894be4e22b2afc06583aa (patch) | |
tree | bd44e2677e5b33ea8aeb4d34f5e2b1b13ba891ce /gst | |
parent | 3137f26544eeff0aaf2bec05417aa85bbd19931c (diff) |
rtpmp4adepay: prevent out-of-bound array access
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtp/gstrtpmp4adepay.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/rtp/gstrtpmp4adepay.c b/gst/rtp/gstrtpmp4adepay.c index 103d389ce..e4343f8db 100644 --- a/gst/rtp/gstrtpmp4adepay.c +++ b/gst/rtp/gstrtpmp4adepay.c @@ -130,7 +130,7 @@ gst_rtp_mp4a_depay_finalize (GObject * object) } static const guint aac_sample_rates[] = { 96000, 88200, 64000, 48000, - 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000 + 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 }; static gboolean @@ -247,6 +247,8 @@ gst_rtp_mp4a_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) /* index of 15 means we get the rate in the next 24 bits */ if (!gst_bit_reader_get_bits_uint32 (&br, &rate, 24)) goto bad_config; + } else if (sr_idx >= G_N_ELEMENTS (aac_sample_rates)) { + goto bad_config; } else { /* else use the rate from the table */ rate = aac_sample_rates[sr_idx]; |