aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-06-10 21:58:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-07 23:36:28 +0200
commitcef720ab429244ac9e56f48d983d6086e0a227a7 (patch)
tree5e1873cff21d9ba11b94fee205d07ff8c4c65905
parent7a0ea15c7afb8abd823303b9a525cc5e6572f199 (diff)
downloadffmpeg-cef720ab429244ac9e56f48d983d6086e0a227a7.tar.gz
avfilter/af_channelsplit: Assert that av_channel_layout_channel_from_index() succeeds
Maybe Helps: CID1503077 Bad bit shift operation Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/af_channelsplit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c
index 1c4e815c6e..43b2667750 100644
--- a/libavfilter/af_channelsplit.c
+++ b/libavfilter/af_channelsplit.c
@@ -22,7 +22,7 @@
*
* Split an audio stream into per-channel streams.
*/
-
+#include "libavutil/avassert.h"
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
@@ -157,6 +157,8 @@ static int filter_frame(AVFilterLink *outlink, AVFrame *buf)
enum AVChannel channel = av_channel_layout_channel_from_index(&buf->ch_layout, s->map[i]);
int ret;
+ av_assert1(channel >= 0);
+
AVFrame *buf_out = av_frame_clone(buf);
if (!buf_out)
return AVERROR(ENOMEM);