Commit 13dbd9b7 authored by Peter Ross's avatar Peter Ross

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.

Originally committed as revision 14658 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bc02bc86
......@@ -209,7 +209,7 @@ static int pcm_encode_frame(AVCodecContext *avctx,
break;
case CODEC_ID_PCM_S24DAUD:
for(;n>0;n--) {
uint32_t tmp = ff_reverse[*samples >> 8] +
uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
(ff_reverse[*samples & 0xff] << 8);
tmp <<= 4; // sync flags would go here
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