diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2014-09-26 16:37:28 -0300 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2014-09-26 18:42:39 -0300 |
commit | a9ea79bb4976382b5648647013290ab61cf031e7 (patch) | |
tree | abe454bfa47e1b12a1dbb123c6456f97e53d921c /libavfilter/af_amix.c | |
parent | 32288234a200f69e1638c7d6e0129d5353e333a3 (diff) | |
download | ffmpeg-streaming-a9ea79bb4976382b5648647013290ab61cf031e7.zip ffmpeg-streaming-a9ea79bb4976382b5648647013290ab61cf031e7.tar.gz |
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>
Diffstat (limited to 'libavfilter/af_amix.c')
-rw-r--r-- | libavfilter/af_amix.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index d8a6651..47cbb45 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -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; } |