Changeset 3250


Ignore:
Timestamp:
Aug 5, 2010 10:41:48 AM (9 years ago)
Author:
nanang
Message:

Re #1072: fixed buffer overflow bugs introduced by r3202.

Location:
pjproject/trunk/pjmedia/src/pjmedia-codec
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/g722.c

    r3202 r3250  
    589589 
    590590        p = (pj_int16_t*)input->buf; 
    591         end = p + input->size; 
     591        end = p + input->size/2; 
    592592        while (p < end) { 
    593593            *p++ >>= g722_data->pcm_shift; 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/g722/g722_dec.c

    r3202 r3250  
    505505    int ilowr, ylow, rlow, dlowt; 
    506506    int ihigh, rhigh, dhigh; 
     507    int pcm1, pcm2; 
    507508    pj_uint8_t *in_ = (pj_uint8_t*) in; 
    508509 
     
    529530        /* rhigh <= output high band pcm */ 
    530531 
    531         rx_qmf(dec, rlow, rhigh, &out[i*2], &out[i*2+1]); 
     532        rx_qmf(dec, rlow, rhigh, &pcm1, &pcm2); 
     533        out[i*2]   = (pj_int16_t)pcm1; 
     534        out[i*2+1] = (pj_int16_t)pcm2; 
    532535    } 
    533536 
Note: See TracChangeset for help on using the changeset viewer.