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 3079a07..de1e6c8 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--) {