Fix off-by-1 read err in switch_xml

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12628 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene
2009-03-16 20:28:22 +00:00
parent 16009c5094
commit 53ab0e2aef
6 changed files with 9 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
BASE=../../../..
DIR=$(BASE)/libs/libg729
A=$(DIR)/.libs/libg729.a
DIR=./g729abc
A=$(DIR)/libg729ab.a
LOCAL_INSERT_CFLAGS=if test -f $(A); then echo "-I$(DIR)/src/include" ; else echo "-DG729_PASSTHROUGH" ; fi ;
LOCAL_INSERT_CFLAGS=if test -f $(A); then echo "-I$(DIR)" ; else echo "-DG729_PASSTHROUGH" ; fi ;
LOCAL_INSERT_LDFLAGS=test ! -f $(A) || echo $(A)
include $(BASE)/build/modmake.rules

View File

@@ -38,7 +38,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load);
SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
#ifndef G729_PASSTHROUGH
#include "g729.h"
#include "g729ab.h"
struct g729_context {
struct dec_state decoder_object;
@@ -112,7 +112,7 @@ static switch_status_t switch_g729_encode(switch_codec_t *codec,
if (decoded_data_len % 160 == 0) {
uint32_t new_len = 0;
INT16 *ddp = decoded_data;
char *edp = encoded_data;
unsigned char *edp = encoded_data;
int x;
int loops = (int) decoded_data_len / 160;
@@ -170,7 +170,7 @@ static switch_status_t switch_g729_decode(switch_codec_t *codec,
if (encoded_data_len % divisor == 0) {
uint8_t *test;
int loops = (int) encoded_data_len / divisor;
char *edp = encoded_data;
unsigned char *edp = encoded_data;
short *ddp = decoded_data;
int x;
uint32_t new_len = 0;