summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/gstreamer/gst-plugins-good-0.10.31/0407-mulawdec-fix-integer-overrun.patch
blob: 48b8e98b817d6e3770df4a5ee4c565b82ded9e16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From ce94b2c2b91b6db190c121860e12a6afafce7ae1 Mon Sep 17 00:00:00 2001
From: Roland Krikava <rkrikava@gmail.com>
Date: Fri, 2 Nov 2012 12:38:44 -0400
Subject: [PATCH 407/440] 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

Commit - 3be45f70220310ec1c60d819f90b5f2ae03b5d83 in 0.10 branch

Upstream Status:  Backported

Signed-off-by: Roland Krikava <rkrikava@gmail.com>
---
 gst/law/mulaw-conversion.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gst/law/mulaw-conversion.c b/gst/law/mulaw-conversion.c
index 8afae80..190a9f5 100644
--- 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];
-- 
1.7.9.5