History

avfilter/af_surround: Check output format

Fixes: CID1516994 Out-of-bounds access Fixes: CID1516996 Out-of-bounds access Fixes: CID1516999 Out-of-bounds access

Michael Niedermayer committed 2 years ago

Commit 22ee55a1 parent 43b62b71 file · +25 −0Browse files

Unified · Split

libavfilter/af_surround.c+25−0
@@ -1123,6 +1123,31 @@ static av_cold int init(AVFilterContext *ctx) · 1122 unmodified lines
11231123 s->create_lfe = av_channel_layout_index_from_channel(&s->out_ch_layout,
11241124 AV_CHAN_LOW_FREQUENCY) >= 0;
11251125
1126+ switch (out_channel_layout) {
1127+ case AV_CH_LAYOUT_MONO:
1128+ case AV_CH_LAYOUT_STEREO:
1129+ case AV_CH_LAYOUT_2POINT1:
1130+ case AV_CH_LAYOUT_2_1:
1131+ case AV_CH_LAYOUT_2_2:
1132+ case AV_CH_LAYOUT_SURROUND:
1133+ case AV_CH_LAYOUT_3POINT1:
1134+ case AV_CH_LAYOUT_QUAD:
1135+ case AV_CH_LAYOUT_4POINT0:
1136+ case AV_CH_LAYOUT_4POINT1:
1137+ case AV_CH_LAYOUT_5POINT0:
1138+ case AV_CH_LAYOUT_5POINT1:
1139+ case AV_CH_LAYOUT_5POINT0_BACK:
1140+ case AV_CH_LAYOUT_5POINT1_BACK:
1141+ case AV_CH_LAYOUT_6POINT0:
1142+ case AV_CH_LAYOUT_6POINT1:
1143+ case AV_CH_LAYOUT_7POINT0:
1144+ case AV_CH_LAYOUT_7POINT1:
1145+ case AV_CH_LAYOUT_OCTAGONAL:
1146+ break;
1147+ default:
1148+ goto fail;
1149+ }
1150+
11261151 switch (in_channel_layout) {
11271152 case AV_CH_LAYOUT_STEREO:
11281153 s->filter = filter_stereo;

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