Mercurial > libavcodec.hg
changeset 7517:d4e19b465fcb libavcodec
Prevent DAUD PCM encoder from fetching values outside of ff_reverse[] array bounds when input sample values are < 0.
author | pross |
---|---|
date | Thu, 07 Aug 2008 08:16:42 +0000 |
parents | 11fe8c09948e |
children | a40c76e98909 |
files | pcm.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/pcm.c Wed Aug 06 21:19:30 2008 +0000 +++ b/pcm.c Thu Aug 07 08:16:42 2008 +0000 @@ -209,7 +209,7 @@ 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);