mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
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>
(cherry picked from commit cef720ab42)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ca5ffb7f46
commit
adab1e6f0c
1 changed files with 3 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
@ -156,6 +156,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue