Commit 57a874d4 authored by michaelni's avatar michaelni

fixing overflow in 16->8 bit conversion, patch by (Nikolai Zhubr <s001 at hotbox dot ru>)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@913 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent efade709
...@@ -209,14 +209,14 @@ static int pcm_encode_frame(AVCodecContext *avctx, ...@@ -209,14 +209,14 @@ static int pcm_encode_frame(AVCodecContext *avctx,
case CODEC_ID_PCM_S8: case CODEC_ID_PCM_S8:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = (v + 128) >> 8; dst[0] = v >> 8;
dst++; dst++;
} }
break; break;
case CODEC_ID_PCM_U8: case CODEC_ID_PCM_U8:
for(;n>0;n--) { for(;n>0;n--) {
v = *samples++; v = *samples++;
dst[0] = ((v + 128) >> 8) + 128; dst[0] = (v >> 8) + 128;
dst++; dst++;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment