History

avcodec/wavarc: really fix bits per sample detection

Paul B Mahol committed 3 years ago

Commit c5aeb8f1 parent 64b242d1 file · +4 −4Browse files

Unified · Split

libavcodec/wavarc.c+4−4
@@ -52,7 +52,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx) · 51 unmodified lines
5252 {
5353 WavArcContext *s = avctx->priv_data;
5454
55− if (avctx->extradata_size < 44)
55+ if (avctx->extradata_size < 52)
5656 return AVERROR_INVALIDDATA;
5757 if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F'))
5858 return AVERROR_INVALIDDATA;
@@ -68,9 +68,9 @@ static av_cold int wavarc_init(AVCodecContext *avctx) · 9 unmodified lines
6868 av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38));
6969 avctx->sample_rate = AV_RL32(avctx->extradata + 40);
7070
71− switch (AV_RL16(avctx->extradata + 38)) {
72− case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;
73− case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;
71+ switch (AV_RL16(avctx->extradata + 50)) {
72+ case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;
73+ case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;
7474 }
7575
7676 s->shift = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t