From 392d975efe9424fe7b1ab3ae308f93f8a51b6c4e Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 10 Feb 2015 14:20:32 +0000 Subject: [PATCH] avcodec: fix clobbered ff_get_buffer() Signed-off-by: Paul B Mahol --- libavcodec/atrac3plusdec.c | 4 +--- libavcodec/fic.c | 4 +--- libavcodec/on2avc.c | 8 ++------ libavcodec/opusdec.c | 4 +--- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 78121e8467..e6f0416317 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -333,10 +333,8 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, float **samples_p = (float **)frame->extended_data; frame->nb_samples = ATRAC3P_FRAME_SAMPLES; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - } if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0) return ret; diff --git a/libavcodec/fic.c b/libavcodec/fic.c index adc8a25d4c..48e7a6ea0a 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -266,10 +266,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, int skip_cursor = 0; uint8_t *sdata; - if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) { - av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); + if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) return ret; - } /* Header + at least one slice (4) */ if (avpkt->size < FIC_HEADER_SIZE + 4) { diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 4ad6eca4e4..4a38da00e5 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -848,10 +848,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data, if (c->is_av500) { /* get output buffer */ frame->nb_samples = ON2AVC_SUBFRAME_SIZE; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - } if ((ret = on2avc_decode_subframe(c, buf, buf_size, frame, 0)) < 0) return ret; @@ -874,10 +872,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data, /* get output buffer */ frame->nb_samples = ON2AVC_SUBFRAME_SIZE * num_frames; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; - } audio_off = 0; bytestream2_init(&gb, buf, buf_size); diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 759eaa529c..84fa0ff988 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -474,10 +474,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, /* setup the data buffers */ ret = ff_get_buffer(avctx, frame, 0); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if (ret < 0) return ret; - } frame->nb_samples = 0; for (i = 0; i < avctx->channels; i++) {