mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
mulawdec: fix integer overrun
There might be more than 65535 samples in a chunk of data. https://bugzilla.gnome.org/show_bug.cgi?id=687469
This commit is contained in:
parent
5d0507c09e
commit
3be45f7022
1 changed files with 4 additions and 2 deletions
6
gst/law/mulaw-conversion.c
Normal file → Executable file
6
gst/law/mulaw-conversion.c
Normal file → Executable file
|
@ -51,9 +51,10 @@ mulaw_encode (gint16 * in, guint8 * out, gint numsamples)
|
||||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
||||||
};
|
};
|
||||||
gint16 sign, exponent, mantissa, i;
|
gint16 sign, exponent, mantissa;
|
||||||
gint16 sample;
|
gint16 sample;
|
||||||
guint8 ulawbyte;
|
guint8 ulawbyte;
|
||||||
|
gint i;
|
||||||
|
|
||||||
for (i = 0; i < numsamples; i++) {
|
for (i = 0; i < numsamples; i++) {
|
||||||
sample = in[i];
|
sample = in[i];
|
||||||
|
@ -102,7 +103,8 @@ mulaw_decode (guint8 * in, gint16 * out, gint numsamples)
|
||||||
static gint16 exp_lut[8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 };
|
static gint16 exp_lut[8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 };
|
||||||
gint16 sign, exponent, mantissa;
|
gint16 sign, exponent, mantissa;
|
||||||
guint8 ulawbyte;
|
guint8 ulawbyte;
|
||||||
gint16 linear, i;
|
gint16 linear;
|
||||||
|
gint i;
|
||||||
|
|
||||||
for (i = 0; i < numsamples; i++) {
|
for (i = 0; i < numsamples; i++) {
|
||||||
ulawbyte = in[i];
|
ulawbyte = in[i];
|
||||||
|
|
Loading…
Reference in a new issue