mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-26 21:10:34 +00:00
libavfilter/af_amix: avoid derreferencing possible null
ff_all_channel_layouts() might return null on alloc failure. Fixes CID1241516 Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
parent
32288234a2
commit
a9ea79bb49
@ -528,10 +528,17 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
AVFilterFormats *formats = NULL;
|
||||
AVFilterChannelLayouts *layouts;
|
||||
|
||||
layouts = ff_all_channel_layouts();
|
||||
|
||||
if (!layouts)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ff_add_format(&formats, AV_SAMPLE_FMT_FLT);
|
||||
ff_add_format(&formats, AV_SAMPLE_FMT_FLTP);
|
||||
ff_set_common_formats(ctx, formats);
|
||||
ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
|
||||
ff_set_common_channel_layouts(ctx, layouts);
|
||||
ff_set_common_samplerates(ctx, ff_all_samplerates());
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user