Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | From ce94b2c2b91b6db190c121860e12a6afafce7ae1 Mon Sep 17 00:00:00 2001 |
| 2 | From: Roland Krikava <rkrikava@gmail.com> |
| 3 | Date: Fri, 2 Nov 2012 12:38:44 -0400 |
| 4 | Subject: [PATCH 407/440] mulawdec: fix integer overrun |
| 5 | |
| 6 | There might be more than 65535 samples in a chunk of data. |
| 7 | |
| 8 | https://bugzilla.gnome.org/show_bug.cgi?id=687469 |
| 9 | |
| 10 | Commit - 3be45f70220310ec1c60d819f90b5f2ae03b5d83 in 0.10 branch |
| 11 | |
| 12 | Upstream Status: Backported |
| 13 | |
| 14 | Signed-off-by: Roland Krikava <rkrikava@gmail.com> |
| 15 | --- |
| 16 | gst/law/mulaw-conversion.c | 6 ++++-- |
| 17 | 1 file changed, 4 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/gst/law/mulaw-conversion.c b/gst/law/mulaw-conversion.c |
| 20 | index 8afae80..190a9f5 100644 |
| 21 | --- a/gst/law/mulaw-conversion.c |
| 22 | +++ b/gst/law/mulaw-conversion.c |
| 23 | @@ -51,9 +51,10 @@ mulaw_encode (gint16 * in, guint8 * out, gint numsamples) |
| 24 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 25 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 |
| 26 | }; |
| 27 | - gint16 sign, exponent, mantissa, i; |
| 28 | + gint16 sign, exponent, mantissa; |
| 29 | gint16 sample; |
| 30 | guint8 ulawbyte; |
| 31 | + gint i; |
| 32 | |
| 33 | for (i = 0; i < numsamples; i++) { |
| 34 | sample = in[i]; |
| 35 | @@ -102,7 +103,8 @@ mulaw_decode (guint8 * in, gint16 * out, gint numsamples) |
| 36 | static gint16 exp_lut[8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 }; |
| 37 | gint16 sign, exponent, mantissa; |
| 38 | guint8 ulawbyte; |
| 39 | - gint16 linear, i; |
| 40 | + gint16 linear; |
| 41 | + gint i; |
| 42 | |
| 43 | for (i = 0; i < numsamples; i++) { |
| 44 | ulawbyte = in[i]; |
| 45 | -- |
| 46 | 1.7.9.5 |
| 47 | |