diff options
author | Peter Ross <pross@xvid.org> | 2008-08-07 08:16:42 +0000 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2008-08-07 08:16:42 +0000 |
commit | 13dbd9b705f016926e25261064463968c78ca93d (patch) | |
tree | cbcc51873cec3948adc3c15a8cda31e3233167d5 /libavcodec/pcm.c | |
parent | bc02bc868608668bc277c6d6af47bfd0d9e24e65 (diff) | |
download | ffmpeg-13dbd9b705f016926e25261064463968c78ca93d.tar.gz |
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
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index d8b013bcb0..3b61518509 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -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); |