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
52{52{
53 WavArcContext *s = avctx->priv_data;53 WavArcContext *s = avctx->priv_data;
54 54
55 if (avctx->extradata_size < 44)55 if (avctx->extradata_size < 52)
56 return AVERROR_INVALIDDATA;56 return AVERROR_INVALIDDATA;
57 if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F'))57 if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F'))
58 return AVERROR_INVALIDDATA;58 return AVERROR_INVALIDDATA;
@@ -68,9 +68,9 @@ static av_cold int wavarc_init(AVCodecContext *avctx) · 9 unmodified lines
68 av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38));68 av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38));
69 avctx->sample_rate = AV_RL32(avctx->extradata + 40);69 avctx->sample_rate = AV_RL32(avctx->extradata + 40);
70 70
71 switch (AV_RL16(avctx->extradata + 38)) {71 switch (AV_RL16(avctx->extradata + 50)) {
72 case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;72 case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break;
73 case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;73 case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break;
74 }74 }
75 75
76 s->shift = 0;76 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