Commit e04b4fd9 authored by pross's avatar pross

Prevent DAUD PCM encoder from fetching values outside of ff_reverse[] array...

Prevent DAUD PCM encoder from fetching values outside of ff_reverse[] array bounds when input sample values are < 0.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14658 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 674f521c
...@@ -209,7 +209,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, ...@@ -209,7 +209,7 @@ static int pcm_encode_frame(AVCodecContext *avctx,
break; break;
case CODEC_ID_PCM_S24DAUD: case CODEC_ID_PCM_S24DAUD:
for(;n>0;n--) { for(;n>0;n--) {
uint32_t tmp = ff_reverse[*samples >> 8] + uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
(ff_reverse[*samples & 0xff] << 8); (ff_reverse[*samples & 0xff] << 8);
tmp <<= 4; // sync flags would go here tmp <<= 4; // sync flags would go here
bytestream_put_be24(&dst, tmp); bytestream_put_be24(&dst, tmp);
......
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