[FFmpeg-cvslog] r14864 - trunk/libavcodec/pcm.c
pross
subversion
Wed Aug 20 13:05:16 CEST 2008
Author: pross
Date: Wed Aug 20 13:05:15 2008
New Revision: 14864
Log:
Fix PCM DVD divide by zero bug introduced in r14659. Patch supplied by lars dot taeuber at gmx dot net.
Modified:
trunk/libavcodec/pcm.c
Modified: trunk/libavcodec/pcm.c
==============================================================================
--- trunk/libavcodec/pcm.c (original)
+++ trunk/libavcodec/pcm.c Wed Aug 20 13:05:15 2008
@@ -350,11 +350,12 @@ static int pcm_decode_frame(AVCodecConte
sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
- n = avctx->channels * sample_size;
/* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
if (CODEC_ID_PCM_DVD == avctx->codec_id)
/* 2 samples are interleaved per block in PCM_DVD */
- n = 2 * avctx->channels * avctx->bits_per_sample/8;
+ sample_size = avctx->bits_per_sample * 2 / 8;
+
+ n = avctx->channels * sample_size;
if(n && buf_size % n){
av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
More information about the ffmpeg-cvslog
mailing list