diff options
author | James Almer <jamrial@gmail.com> | 2022-03-25 09:22:55 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-25 09:24:39 -0300 |
commit | e4f6fce9e0285778833179ae2c3b898231460e48 (patch) | |
tree | 956b17eec4175a5f570f3256cece11aab593dac1 /libavutil | |
parent | b04f14136e54f2db167d341d9bda0e30d11320fd (diff) | |
download | ffmpeg-e4f6fce9e0285778833179ae2c3b898231460e48.tar.gz |
avutil/channel_layout: add missing check for AV_CHAN_NONE in av_channel_description
Prevents printing "user -1" on invalid channel ids.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/channel_layout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index 2d4ccae1bf..c28b8928da 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -119,6 +119,8 @@ void av_channel_description_bprint(AVBPrint *bp, enum AVChannel channel_id) else if ((unsigned)channel_id < FF_ARRAY_ELEMS(channel_names) && channel_names[channel_id].description) av_bprintf(bp, "%s", channel_names[channel_id].description); + else if (channel_id == AV_CHAN_NONE) + av_bprintf(bp, "none"); else av_bprintf(bp, "user %d", channel_id); } |