Mercurial > libavcodec.hg
comparison pcm.c @ 2506:9404bbf9de07 libavcodec
buffer overflow
author | michael |
---|---|
date | Sun, 13 Feb 2005 23:36:04 +0000 |
parents | a2073e67cb19 |
children | 6f7428adc6ad |
comparison
equal
deleted
inserted
replaced
2505:86e2b1424801 | 2506:9404bbf9de07 |
---|---|
297 uint8_t *src; | 297 uint8_t *src; |
298 | 298 |
299 samples = data; | 299 samples = data; |
300 src = buf; | 300 src = buf; |
301 | 301 |
302 if(buf_size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2) | |
303 buf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE/2; | |
304 | |
302 switch(avctx->codec->id) { | 305 switch(avctx->codec->id) { |
303 case CODEC_ID_PCM_S16LE: | 306 case CODEC_ID_PCM_S16LE: |
304 n = buf_size >> 1; | 307 n = buf_size >> 1; |
305 for(;n>0;n--) { | 308 for(;n>0;n--) { |
306 *samples++ = src[0] | (src[1] << 8); | 309 *samples++ = src[0] | (src[1] << 8); |