summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-10 13:18:05 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-10 13:18:05 +0200
commit50b5477616c8f6001a575fb953db45dd9a14662c (patch)
tree4af87567da08f040334d6ac938528c14b116825c /libavfilter
parenteadba3e94daac2f48fd9ce7c9fdf5a562d3274ed (diff)
parentb94e4acb4874843e914fd3cb8e089aff0756bb4a (diff)
downloadffmpeg-streaming-50b5477616c8f6001a575fb953db45dd9a14662c.zip
ffmpeg-streaming-50b5477616c8f6001a575fb953db45dd9a14662c.tar.gz
Merge commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a'
* commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a': cmdutils_read_file: increment *size after writing the trailing \0 af_resample: unref out_buf when avresample_convert returns 0 af_amix: prevent memory leak on error path vc1dec: prevent memory leak in error path vc1dec: prevent memory leak on av_realloc error af_channelmap: free old extended_data on reallocation avconv: simplify memory allocation in copy_chapters matroskaenc: check cue point validity before reallocation swfenc: error out for more than 1 audio or video stream build: link test programs only against static libs Conflicts: ffmpeg_opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_amix.c4
-rw-r--r--libavfilter/af_channelmap.c2
-rw-r--r--libavfilter/af_resample.c5
3 files changed, 7 insertions, 4 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 9d0f998..c804cec 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -280,8 +280,10 @@ static int output_frame(AVFilterLink *outlink, int nb_samples)
return AVERROR(ENOMEM);
in_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples);
- if (!in_buf)
+ if (!in_buf) {
+ avfilter_unref_buffer(out_buf);
return AVERROR(ENOMEM);
+ }
for (i = 0; i < s->nb_inputs; i++) {
if (s->input_state[i] == INPUT_ON) {
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 50289c3..211abd7 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -337,8 +337,8 @@ static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *bu
if (buf->extended_data == buf->data) {
buf->extended_data = new_extended_data;
} else {
- buf->extended_data = new_extended_data;
av_free(buf->extended_data);
+ buf->extended_data = new_extended_data;
}
} else if (buf->extended_data != buf->data) {
av_free(buf->extended_data);
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index 58a9b2a..c43d260 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -194,9 +194,10 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
buf_out->linesize[0], nb_samples,
buf->extended_data, buf->linesize[0],
buf->audio->nb_samples);
- if (ret < 0) {
+ if (ret <= 0) {
avfilter_unref_buffer(buf_out);
- goto fail;
+ if (ret < 0)
+ goto fail;
}
av_assert0(!avresample_available(s->avr));
OpenPOWER on IntegriCloud