lavfi: always check return value of ff_get_{audio,video}_buffer()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/21/head
Paul B Mahol 12 years ago
parent e82f562fa5
commit ed8373e7db
  1. 2
      libavfilter/af_aconvert.c
  2. 2
      libavfilter/af_amerge.c
  3. 3
      libavfilter/af_asetnsamples.c
  4. 4
      libavfilter/af_atempo.c
  5. 2
      libavfilter/af_pan.c
  6. 2
      libavfilter/asrc_aevalsrc.c
  7. 2
      libavfilter/vf_tinterlace.c
  8. 2
      libavfilter/vsrc_cellauto.c
  9. 2
      libavfilter/vsrc_life.c
  10. 3
      libavfilter/vsrc_mandelbrot.c
  11. 2
      libavfilter/vsrc_mptestsrc.c

@ -143,6 +143,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
AVFrame *outsamplesref = ff_get_audio_buffer(outlink, n);
int ret;
if (!outsamplesref)
return AVERROR(ENOMEM);
swr_convert(aconvert->swr, outsamplesref->extended_data, n,
(void *)insamplesref->extended_data, n);

@ -248,6 +248,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return 0;
outbuf = ff_get_audio_buffer(ctx->outputs[0], nb_samples);
if (!outbuf)
return AVERROR(ENOMEM);
outs = outbuf->data[0];
for (i = 0; i < am->nb_inputs; i++) {
inbuf[i] = ff_bufqueue_peek(&am->in[i].queue, 0);

@ -108,7 +108,8 @@ static int push_samples(AVFilterLink *outlink)
return 0;
outsamples = ff_get_audio_buffer(outlink, nb_out_samples);
av_assert0(outsamples);
if (!outsamples)
return AVERROR(ENOMEM);
av_audio_fifo_read(asns->fifo,
(void **)outsamples->extended_data, nb_out_samples);

@ -1062,6 +1062,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)
while (src < src_end) {
if (!atempo->dst_buffer) {
atempo->dst_buffer = ff_get_audio_buffer(outlink, n_out);
if (!atempo->dst_buffer)
return AVERROR(ENOMEM);
av_frame_copy_props(atempo->dst_buffer, src_buffer);
atempo->dst = atempo->dst_buffer->data[0];
@ -1100,6 +1102,8 @@ static int request_frame(AVFilterLink *outlink)
while (err == AVERROR(EAGAIN)) {
if (!atempo->dst_buffer) {
atempo->dst_buffer = ff_get_audio_buffer(outlink, n_max);
if (!atempo->dst_buffer)
return AVERROR(ENOMEM);
atempo->dst = atempo->dst_buffer->data[0];
atempo->dst_end = atempo->dst + n_max * atempo->stride;

@ -361,6 +361,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
AVFrame *outsamples = ff_get_audio_buffer(outlink, n);
PanContext *pan = inlink->dst->priv;
if (!outsamples)
return AVERROR(ENOMEM);
swr_convert(pan->swr, outsamples->data, n, (void *)insamples->data, n);
av_frame_copy_props(outsamples, insamples);
outsamples->channel_layout = outlink->channel_layout;

@ -220,6 +220,8 @@ static int request_frame(AVFilterLink *outlink)
return AVERROR_EOF;
samplesref = ff_get_audio_buffer(outlink, eval->nb_samples);
if (!samplesref)
return AVERROR(ENOMEM);
/* evaluate expression for each single sample and for each channel */
for (i = 0; i < eval->nb_samples; i++, eval->n++) {

@ -266,6 +266,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
case MODE_PAD: /* expand each frame to double height, but pad alternate
* lines with black; framerate unchanged */
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out)
return AVERROR(ENOMEM);
av_frame_copy_props(out, cur);
out->height = outlink->h;

@ -294,6 +294,8 @@ static int request_frame(AVFilterLink *outlink)
{
CellAutoContext *cellauto = outlink->src->priv;
AVFrame *picref = ff_get_video_buffer(outlink, cellauto->w, cellauto->h);
if (!picref)
return AVERROR(ENOMEM);
picref->sample_aspect_ratio = (AVRational) {1, 1};
if (cellauto->generation == 0 && cellauto->start_full) {
int i;

@ -420,6 +420,8 @@ static int request_frame(AVFilterLink *outlink)
{
LifeContext *life = outlink->src->priv;
AVFrame *picref = ff_get_video_buffer(outlink, life->w, life->h);
if (!picref)
return AVERROR(ENOMEM);
picref->sample_aspect_ratio = (AVRational) {1, 1};
picref->pts = life->pts++;

@ -403,6 +403,9 @@ static int request_frame(AVFilterLink *link)
{
MBContext *mb = link->src->priv;
AVFrame *picref = ff_get_video_buffer(link, mb->w, mb->h);
if (!picref)
return AVERROR(ENOMEM);
picref->sample_aspect_ratio = (AVRational) {1, 1};
picref->pts = mb->pts++;

@ -323,6 +323,8 @@ static int request_frame(AVFilterLink *outlink)
if (test->max_pts >= 0 && test->pts > test->max_pts)
return AVERROR_EOF;
picref = ff_get_video_buffer(outlink, w, h);
if (!picref)
return AVERROR(ENOMEM);
picref->pts = test->pts++;
// clean image

Loading…
Cancel
Save