mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-16 03:37:00 +00:00
avutil/channel_layout: av_channel_layout_describe_bprint: Check for buffer end
Fixes: Timeout printing a billion channels Fixes: 48099/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6754782204788736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c6f1e48b86
commit
8154cb7c2f
@ -757,6 +757,10 @@ int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout,
|
||||
if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM &&
|
||||
channel_layout->u.map[i].name[0])
|
||||
av_bprintf(bp, "@%s", channel_layout->u.map[i].name);
|
||||
|
||||
if (!av_bprint_is_complete(bp))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
}
|
||||
if (channel_layout->nb_channels) {
|
||||
av_bprintf(bp, ")");
|
||||
|
Loading…
Reference in New Issue
Block a user