diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-15 11:16:53 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 09:14:05 +0200 |
commit | 1dc42050185d63c1de5d16146fbaee92640af187 (patch) | |
tree | e53dbbfc52894acf4efd526b9ddcaf1d0b87d94d /libavfilter/split.c | |
parent | 80e4ed279b3abe9f5356e2b56255b2aa64527345 (diff) | |
download | ffmpeg-1dc42050185d63c1de5d16146fbaee92640af187.tar.gz |
lavfi: check all avfilter_ref_buffer() calls for errors.
Diffstat (limited to 'libavfilter/split.c')
-rw-r--r-- | libavfilter/split.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libavfilter/split.c b/libavfilter/split.c index 469f69d76a..084d555f1a 100644 --- a/libavfilter/split.c +++ b/libavfilter/split.c @@ -69,8 +69,11 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) int i, ret = 0; for (i = 0; i < ctx->nb_outputs; i++) { - ret = ff_start_frame(ctx->outputs[i], - avfilter_ref_buffer(picref, ~AV_PERM_WRITE)); + AVFilterBufferRef *buf_out = avfilter_ref_buffer(picref, ~AV_PERM_WRITE); + if (!buf_out) + return AVERROR(ENOMEM); + + ret = ff_start_frame(ctx->outputs[i], buf_out); if (ret < 0) break; } @@ -126,8 +129,14 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) int i, ret = 0; for (i = 0; i < ctx->nb_outputs; i++) { - ret = ff_filter_samples(inlink->dst->outputs[i], - avfilter_ref_buffer(samplesref, ~AV_PERM_WRITE)); + AVFilterBufferRef *buf_out = avfilter_ref_buffer(samplesref, + ~AV_PERM_WRITE); + if (!buf_out) { + ret = AVERROR(ENOMEM); + break; + } + + ret = ff_filter_samples(inlink->dst->outputs[i], buf_out); if (ret < 0) break; } |