Ignore:
Timestamp:
Jan 11, 2008 8:52:18 AM (17 years ago)
Author:
bennylp
Message:

Fixed what looks like a bug in pjmedia's Speex decoder: decoder may return invalid PCM frame length

File:
1 edited

Legend:

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

    r1266 r1677  
    773773    spx = (struct spx_private*) codec->codec_data; 
    774774 
     775    PJ_ASSERT_RETURN(output_buf_len >= 320, PJMEDIA_CODEC_EPCMTOOSHORT); 
     776 
    775777    if (input->type != PJMEDIA_FRAME_TYPE_AUDIO) { 
    776         pj_bzero(output->buf, output_buf_len); 
     778        pjmedia_zero_samples((pj_int16_t*)output->buf, 160); 
    777779        output->size = 320; 
    778780        output->timestamp.u64 = input->timestamp.u64; 
     
    788790 
    789791    output->type = PJMEDIA_FRAME_TYPE_AUDIO; 
    790     output->size = speex_bits_nbytes(&spx->dec_bits); 
    791     pj_assert(output->size <= (unsigned)output_buf_len); 
     792    output->size = 320; 
    792793    output->timestamp.u64 = input->timestamp.u64; 
    793794 
Note: See TracChangeset for help on using the changeset viewer.