Fix CODEC_ID_PCM_U8 decoder output size calculation to support odd-number of samples.
authorPeter Ross <pross@xvid.org>
Tue, 12 Aug 2008 12:32:40 +0000 (12:32 +0000)
committerPeter Ross <pross@xvid.org>
Tue, 12 Aug 2008 12:32:40 +0000 (12:32 +0000)
Originally committed as revision 14712 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/pcm.c

index 3079a07caeead01b526dcaa1a089f9a1410845d1..de1e6c899fffb5d34739f77924ba9cb66d376b79 100644 (file)
@@ -411,7 +411,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
     case CODEC_ID_PCM_U8:
         memcpy(samples, src, n);
         src += n;
-        samples += n/2;
+        samples = (short*)((uint8_t*)data + n);
         break;
     case CODEC_ID_PCM_ZORK:
         for(;n>0;n--) {