[FFmpeg-cvslog] r14658 - trunk/libavcodec/pcm.c

pross subversion
Thu Aug 7 10:16:42 CEST 2008


Author: pross
Date: Thu Aug  7 10:16:42 2008
New Revision: 14658

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


Modified:
   trunk/libavcodec/pcm.c

Modified: trunk/libavcodec/pcm.c
==============================================================================
--- trunk/libavcodec/pcm.c	(original)
+++ trunk/libavcodec/pcm.c	Thu Aug  7 10:16:42 2008
@@ -209,7 +209,7 @@ static int pcm_encode_frame(AVCodecConte
         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);




More information about the ffmpeg-cvslog mailing list