[FFmpeg-cvslog] avcodec/wavarc: really fix bits per sample detection
Paul B Mahol
git at videolan.org
Mon Feb 6 19:28:39 EET 2023
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Feb 6 18:26:01 2023 +0100| [c5aeb8f4db5529cdb5248bbb7154adf6f0c8faf3] | committer: Paul B Mahol
avcodec/wavarc: really fix bits per sample detection
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5aeb8f4db5529cdb5248bbb7154adf6f0c8faf3
---
libavcodec/wavarc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c
index b18a88000b..20371b53de 100644
--- a/libavcodec/wavarc.c
+++ b/libavcodec/wavarc.c
@@ -52,7 +52,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx)
{
WavArcContext *s = avctx->priv_data;
- if (avctx->extradata_size < 44)
+ if (avctx->extradata_size < 52)
return AVERROR_INVALIDDATA;
if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F'))
return AVERROR_INVALIDDATA;
@@ -68,9 +68,9 @@ static av_cold int wavarc_init(AVCodecContext *avctx)
av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38));
avctx->sample_rate = AV_RL32(avctx->extradata + 40);
- switch (AV_RL16(avctx->extradata + 38)) {
- case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;
- case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;
+ switch (AV_RL16(avctx->extradata + 50)) {
+ case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;
+ case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;
}
s->shift = 0;
More information about the ffmpeg-cvslog
mailing list