diff options
author | Roland Krikava <rkrikava@gmail.com> | 2012-11-02 12:38:44 -0400 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-11-24 14:36:14 +0000 |
commit | c0f5185a163c18a35380ecc0dcca216c5543fc1b (patch) | |
tree | 32feb3a7fe93aba38a2422820440621745087a35 | |
parent | 91c880067012f26791bb6f86c2ea596a6df01bc6 (diff) |
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
-rwxr-xr-x[-rw-r--r--] | gst/law/mulaw-conversion.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/law/mulaw-conversion.c b/gst/law/mulaw-conversion.c index 8afae806f..190a9f547 100644..100755 --- a/gst/law/mulaw-conversion.c +++ b/gst/law/mulaw-conversion.c @@ -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 }; - gint16 sign, exponent, mantissa, i; + gint16 sign, exponent, mantissa; gint16 sample; guint8 ulawbyte; + gint i; for (i = 0; i < numsamples; 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 }; gint16 sign, exponent, mantissa; guint8 ulawbyte; - gint16 linear, i; + gint16 linear; + gint i; for (i = 0; i < numsamples; i++) { ulawbyte = in[i]; |