Skip to content
Snippets Groups Projects
Commit b9f8a89d authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#5249] Fix uninitialized variable used in conditional jumps

parent 93c6716f
No related branches found
No related tags found
No related merge requests found
...@@ -82,7 +82,7 @@ class AudioLayer ...@@ -82,7 +82,7 @@ class AudioLayer
, _outChannel (1) , _outChannel (1)
, _errorMessage (0) , _errorMessage (0)
, _mutex () , _mutex ()
, countNotificationTime(0) , _countNotificationTime(0)
, _time (new ost::Time()) { , _time (new ost::Time()) {
} }
......
...@@ -66,6 +66,11 @@ class G722 : public AudioCodec ...@@ -66,6 +66,11 @@ class G722 : public AudioCodec
} }
~G722() {
g722_decode_release();
g722_encode_release();
}
virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) {
int in_byte = size; int in_byte = size;
...@@ -118,6 +123,8 @@ class G722 : public AudioCodec ...@@ -118,6 +123,8 @@ class G722 : public AudioCodec
decode_s->packed = FALSE; decode_s->packed = FALSE;
decode_s->band[0].det = 32; decode_s->band[0].det = 32;
decode_s->band[1].det = 8; decode_s->band[1].det = 8;
decode_s->in_bits = 0;
} }
int16_t saturate (int32_t amp) { int16_t saturate (int32_t amp) {
...@@ -137,10 +144,10 @@ class G722 : public AudioCodec ...@@ -137,10 +144,10 @@ class G722 : public AudioCodec
void block4_encode (int band, int d) { void block4_encode (int band, int d) {
int wd1; int wd1 = 0;
int wd2; int wd2 = 0;
int wd3; int wd3 = 0;
int i; int i = 0;
/* Block 4, RECONS */ /* Block 4, RECONS */
encode_s->band[band].d[0] = d; encode_s->band[band].d[0] = d;
...@@ -241,10 +248,10 @@ class G722 : public AudioCodec ...@@ -241,10 +248,10 @@ class G722 : public AudioCodec
} }
void block4_decode (int band, int d) { void block4_decode (int band, int d) {
int wd1; int wd1 = 0;
int wd2; int wd2 = 0;
int wd3; int wd3 = 0;
int i; int i = 0;
/* Block 4, RECONS */ /* Block 4, RECONS */
decode_s->band[band].d[0] = d; decode_s->band[band].d[0] = d;
...@@ -347,12 +354,14 @@ class G722 : public AudioCodec ...@@ -347,12 +354,14 @@ class G722 : public AudioCodec
int g722_encode_release() { int g722_encode_release() {
delete decode_s; delete decode_s;
decode_s = NULL;
return 0; return 0;
} }
int g722_decode_release() { int g722_decode_release() {
delete encode_s; delete encode_s;
encode_s = NULL;
return 0; return 0;
} }
...@@ -407,24 +416,26 @@ class G722 : public AudioCodec ...@@ -407,24 +416,26 @@ class G722 : public AudioCodec
3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11, 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
}; };
int dlowt; int dlowt = 0;
int rlow; int rlow = 0;
int ihigh; int ihigh = 0;
int dhigh; int dhigh = 0;
int rhigh; int rhigh = 0;
int xout1; int xout1 = 0;
int xout2; int xout2 = 0;
int wd1; int wd1 = 0;
int wd2; int wd2 = 0;
int wd3; int wd3 = 0;
int code; int code = 0;
int outlen; int outlen = 0;
int i; int i = 0;
int j; int j = 0;
outlen = 0; outlen = 0;
rhigh = 0; rhigh = 0;
for (j = 0; j < len;) { for (j = 0; j < len;) {
if (decode_s->packed) { if (decode_s->packed) {
/* Unpack the code bits */ /* Unpack the code bits */
...@@ -630,30 +641,30 @@ class G722 : public AudioCodec ...@@ -630,30 +641,30 @@ class G722 : public AudioCodec
static const int wh[3] = {0, -214, 798}; static const int wh[3] = {0, -214, 798};
static const int rh2[4] = {2, 1, 2, 1}; static const int rh2[4] = {2, 1, 2, 1};
int dlow; int dlow = 0;
int dhigh; int dhigh = 0;
int el; int el = 0;
int wd; int wd = 0;
int wd1; int wd1 = 0;
int ril; int ril = 0;
int wd2; int wd2 = 0;
int il4; int il4 = 0;
int ih2; int ih2 = 0;
int wd3; int wd3 = 0;
int eh; int eh = 0;
int mih; int mih = 0;
int i; int i = 0;
int j; int j = 0;
/* Low and high band PCM from the QMF */ /* Low and high band PCM from the QMF */
int xlow; int xlow = 0;
int xhigh; int xhigh = 0;
int g722_bytes; int g722_bytes = 0;
/* Even and odd tap accumulators */ /* Even and odd tap accumulators */
int sumeven; int sumeven = 0;
int sumodd; int sumodd = 0;
int ihigh; int ihigh = 0;
int ilow; int ilow = 0;
int code; int code = 9;
g722_bytes = 0; g722_bytes = 0;
xhigh = 0; xhigh = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment