[FFmpeg-devel] [PATCH] lavc: factorize {re, }get_buffer error message.

Clément Bœsch ubitux at gmail.com
Tue Mar 12 09:37:32 CET 2013


Coccinelle profile used:

  @@
  expression r, ctx, f, loglevel, str, flags;
  @@

  -if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_get_buffer(ctx, f, flags)) < 0)
  +    return r;

  @@
  expression r, ctx, f, loglevel, str;
  @@

  -if ((r = ff_reget_buffer(ctx, f)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_reget_buffer(ctx, f)) < 0)
  +    return r;
---
 libavcodec/4xm.c             |  8 ++------
 libavcodec/8bps.c            |  4 +---
 libavcodec/8svx.c            |  4 +---
 libavcodec/aacdec.c          |  4 +---
 libavcodec/aasc.c            |  4 +---
 libavcodec/ac3dec.c          |  4 +---
 libavcodec/adpcm.c           |  4 +---
 libavcodec/adxdec.c          |  4 +---
 libavcodec/alac.c            |  4 +---
 libavcodec/alsdec.c          |  4 +---
 libavcodec/amrnbdec.c        |  6 ++----
 libavcodec/amrwbdec.c        |  4 +---
 libavcodec/anm.c             |  4 +---
 libavcodec/apedec.c          |  4 +---
 libavcodec/asvdec.c          |  4 +---
 libavcodec/atrac1.c          |  4 +---
 libavcodec/atrac3.c          |  4 +---
 libavcodec/aura.c            |  4 +---
 libavcodec/avrndec.c         |  4 +---
 libavcodec/avs.c             |  4 +---
 libavcodec/bethsoftvideo.c   |  4 +---
 libavcodec/bfi.c             |  4 +---
 libavcodec/bink.c            |  8 ++------
 libavcodec/binkaudio.c       |  4 +---
 libavcodec/bmp.c             |  4 +---
 libavcodec/bmv.c             |  8 ++------
 libavcodec/brender_pix.c     |  4 +---
 libavcodec/c93.c             |  4 +---
 libavcodec/cdxl.c            |  4 +---
 libavcodec/cinepak.c         |  4 +---
 libavcodec/cljr.c            |  4 +---
 libavcodec/cngdec.c          |  4 +---
 libavcodec/cook.c            |  4 +---
 libavcodec/cpia.c            |  4 +---
 libavcodec/cscd.c            |  4 +---
 libavcodec/cyuv.c            |  4 +---
 libavcodec/dcadec.c          |  4 +---
 libavcodec/dpcm.c            |  4 +---
 libavcodec/dpx.c             |  4 +---
 libavcodec/dsicinav.c        |  4 +---
 libavcodec/dxa.c             |  4 +---
 libavcodec/eacmv.c           |  4 +---
 libavcodec/eamad.c           |  4 +---
 libavcodec/eatgq.c           |  4 +---
 libavcodec/eatqi.c           |  4 +---
 libavcodec/escape124.c       |  4 +---
 libavcodec/ffv1dec.c         |  4 +---
 libavcodec/flacdec.c         |  4 +---
 libavcodec/flashsv.c         |  4 +---
 libavcodec/flicvideo.c       |  8 ++------
 libavcodec/frwu.c            |  4 +---
 libavcodec/g722dec.c         |  4 +---
 libavcodec/g723_1.c          |  6 ++----
 libavcodec/g726.c            |  4 +---
 libavcodec/g729dec.c         |  4 +---
 libavcodec/gifdec.c          |  8 ++------
 libavcodec/gsmdec.c          |  4 +---
 libavcodec/idcinvideo.c      |  4 +---
 libavcodec/iff.c             |  4 +---
 libavcodec/interplayvideo.c  |  4 +---
 libavcodec/ivi_common.c      |  4 +---
 libavcodec/jvdec.c           |  4 +---
 libavcodec/kmvc.c            |  4 +---
 libavcodec/lcldec.c          |  4 +---
 libavcodec/libgsm.c          |  4 +---
 libavcodec/libilbc.c         |  4 +---
 libavcodec/libopencore-amr.c |  8 ++------
 libavcodec/libspeexdec.c     |  4 +---
 libavcodec/libvorbisdec.c    |  4 +---
 libavcodec/loco.c            |  4 +---
 libavcodec/mace.c            |  4 +---
 libavcodec/mlpdec.c          |  4 +---
 libavcodec/mmvideo.c         |  4 +---
 libavcodec/motionpixels.c    |  4 +---
 libavcodec/mpc7.c            |  4 +---
 libavcodec/mpc8.c            |  4 +---
 libavcodec/mpegaudiodec.c    |  8 ++------
 libavcodec/msrle.c           |  4 +---
 libavcodec/mss1.c            |  4 +---
 libavcodec/mss2.c            |  8 ++------
 libavcodec/mss3.c            |  4 +---
 libavcodec/mss4.c            |  4 +---
 libavcodec/nellymoserdec.c   |  4 +---
 libavcodec/pcm-mpeg.c        |  4 +---
 libavcodec/pcm.c             |  4 +---
 libavcodec/pcx.c             |  4 +---
 libavcodec/pictordec.c       |  4 +---
 libavcodec/pnmdec.c          |  4 +---
 libavcodec/ptx.c             |  4 +---
 libavcodec/qcelpdec.c        |  4 +---
 libavcodec/qdm2.c            |  4 +---
 libavcodec/qdrw.c            |  4 +---
 libavcodec/qpeg.c            |  4 +---
 libavcodec/ra144dec.c        |  4 +---
 libavcodec/ra288.c           |  4 +---
 libavcodec/ralf.c            |  4 +---
 libavcodec/roqvideodec.c     |  4 +---
 libavcodec/rpza.c            |  4 +---
 libavcodec/s302m.c           |  4 +---
 libavcodec/sanm.c            |  4 +---
 libavcodec/shorten.c         |  4 +---
 libavcodec/sipr.c            |  4 +---
 libavcodec/smacker.c         |  8 ++------
 libavcodec/snow.c            |  5 ++---
 libavcodec/sonic.c           |  4 +---
 libavcodec/sunrast.c         |  4 +---
 libavcodec/targa.c           |  4 +---
 libavcodec/tiff.c            |  4 +---
 libavcodec/tmv.c             |  4 +---
 libavcodec/truemotion2.c     |  4 +---
 libavcodec/truespeech.c      |  4 +---
 libavcodec/tscc.c            |  4 +---
 libavcodec/tscc2.c           |  4 +---
 libavcodec/tta.c             |  4 +---
 libavcodec/twinvq.c          |  4 +---
 libavcodec/txd.c             |  4 +---
 libavcodec/ulti.c            |  4 +---
 libavcodec/utils.c           | 20 ++++++++++++++++++--
 libavcodec/vb.c              |  4 +---
 libavcodec/vcr1.c            |  4 +---
 libavcodec/vima.c            |  4 +---
 libavcodec/vmdav.c           |  4 +---
 libavcodec/vmnc.c            |  4 +---
 libavcodec/vorbisdec.c       |  4 +---
 libavcodec/wavpack.c         |  4 +---
 libavcodec/wmadec.c          |  4 +---
 libavcodec/wmavoice.c        |  4 +---
 libavcodec/ws-snd1.c         |  4 +---
 libavcodec/xl.c              |  4 +---
 libavcodec/xwddec.c          |  4 +---
 libavcodec/zmbv.c            |  4 +---
 131 files changed, 160 insertions(+), 421 deletions(-)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 6a63491..cd22aa4 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -884,10 +884,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     // alternatively we would have to use our own buffer management
     avctx->flags |= CODEC_FLAG_EMU_EDGE;
 
-    if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, f->current_picture)) < 0)
         return ret;
-    }
 
     if (frame_4cc == AV_RL32("ifr2")) {
         f->current_picture->pict_type = AV_PICTURE_TYPE_I;
@@ -904,10 +902,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     } else if (frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")) {
         if (!f->last_picture->data[0]) {
             if ((ret = ff_get_buffer(avctx, f->last_picture,
-                                     AV_GET_BUFFER_FLAG_REF)) < 0) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+                                     AV_GET_BUFFER_FLAG_REF)) < 0)
                 return ret;
-            }
             for (i=0; i<avctx->height; i++)
                 memset(f->last_picture->data[0] + i*f->last_picture->linesize[0], 0, 2*avctx->width);
         }
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index 5f5dde6..a910551 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -70,10 +70,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     unsigned char *planemap = c->planemap;
     int ret;
 
-    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;
-    }
 
     /* Set data pointer after line lengths */
     dp = encoded + planes * (height << 1);
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index 8f0fbad..82fda6f 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -136,10 +136,8 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = buf_size * 2;
-    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;
-    }
 
     for (ch = 0; ch < avctx->channels; ch++) {
         delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx],
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index c69ec15..130996d 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -192,10 +192,8 @@ static int frame_configure_elements(AVCodecContext *avctx)
     /* get output buffer */
     av_frame_unref(ac->frame);
     ac->frame->nb_samples = 2048;
-    if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
         return ret;
-    }
 
     /* map output channel pointers to AVFrame data */
     for (ch = 0; ch < avctx->channels; ch++) {
diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c
index b470196..d3bddc6 100644
--- a/libavcodec/aasc.c
+++ b/libavcodec/aasc.c
@@ -91,10 +91,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
-    }
 
     compr     = AV_RL32(buf);
     buf      += 4;
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 87f1067..0e584a5 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1375,10 +1375,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = s->num_blocks * 256;
-    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;
-    }
 
     /* decode the audio blocks */
     channel_map = ff_ac3_dec_channel_map[s->output_mode & ~AC3_OUTPUT_LFEON][s->lfe_on];
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index a995b55..3d6115c 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -637,10 +637,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = nb_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;
-    }
     samples = (short *)frame->data[0];
     samples_p = (int16_t **)frame->extended_data;
 
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index b5868a0..7d7fe3a 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -142,10 +142,8 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = num_blocks * BLOCK_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;
-    }
     samples = (int16_t **)frame->extended_data;
     samples_offset = 0;
 
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 532b7ab..ca219c1 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -289,10 +289,8 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
     if (!alac->nb_samples) {
         /* get output buffer */
         frame->nb_samples = output_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;
-        }
     } else if (output_samples != alac->nb_samples) {
         av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
                output_samples, alac->nb_samples);
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d7cad19..31bf2ab 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1480,10 +1480,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
 
     /* get output buffer */
     frame->nb_samples = ctx->cur_frame_length;
-    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;
-    }
 
     // transform decoded frame into output format
     #define INTERLEAVE_OUTPUT(bps)                                                   \
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index d186dcc..215729a 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -963,10 +963,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = AMR_BLOCK_SIZE;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return ret;
-    }
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+    return ret;
     buf_out = (float *)frame->data[0];
 
     p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 0e9446f..dae4745 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -1112,10 +1112,8 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 4 * AMRWB_SFR_SIZE_16k;
-    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;
-    }
     buf_out = (float *)frame->data[0];
 
     header_size      = decode_mime_header(ctx, buf);
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 4e9737f..0b8f7c8 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -117,10 +117,8 @@ static int decode_frame(AVCodecContext *avctx,
     uint8_t *dst, *dst_end;
     int count, ret;
 
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
-    }
     dst     = s->frame->data[0];
     dst_end = s->frame->data[0] + s->frame->linesize[0]*avctx->height;
 
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 8752341..e6538a2 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -904,10 +904,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = blockstodecode;
-    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;
-    }
 
     s->error=0;
 
diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index 532c9e5..7dca22b 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -210,10 +210,8 @@ static int decode_frame(AVCodecContext *avctx,
     AVFrame * const p     = data;
     int mb_x, mb_y, ret;
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 5db6085..ff7dd3e 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -287,10 +287,8 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = AT1_SU_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;
-    }
 
     for (ch = 0; ch < avctx->channels; ch++) {
         AT1SUCtx* su = &q->SUs[ch];
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 0c42a6d..eb42ed2 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -813,10 +813,8 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = SAMPLES_PER_FRAME;
-    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;
-    }
 
     /* Check if we need to descramble and what buffer to pass on. */
     if (q->scrambled_stream) {
diff --git a/libavcodec/aura.c b/libavcodec/aura.c
index bb2be7e..34d46ae 100644
--- a/libavcodec/aura.c
+++ b/libavcodec/aura.c
@@ -59,10 +59,8 @@ static int aura_decode_frame(AVCodecContext *avctx,
     /* pixel data starts 48 bytes in, after 3x16-byte tables */
     buf += 48;
 
-    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;
-    }
 
     Y = frame->data[0];
     U = frame->data[1];
diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c
index 882ee50..40aca17 100644
--- a/libavcodec/avrndec.c
+++ b/libavcodec/avrndec.c
@@ -93,10 +93,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    if((ret = ff_get_buffer(avctx, p, 0)) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type= AV_PICTURE_TYPE_I;
     p->key_frame= 1;
 
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index a6e020a..e3733d7 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -60,10 +60,8 @@ avs_decode_frame(AVCodecContext * avctx,
     AvsBlockType type;
     GetBitContext change_map = {0}; //init to silence warning
 
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, p)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_P;
     p->key_frame = 0;
 
diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c
index ed9525a..474265f 100644
--- a/libavcodec/bethsoftvideo.c
+++ b/libavcodec/bethsoftvideo.c
@@ -75,10 +75,8 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
     int code, ret;
     int yoffset;
 
-    if ((ret = ff_reget_buffer(avctx, &vid->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &vid->frame)) < 0)
         return ret;
-    }
     wrap_to_next_line = vid->frame.linesize[0] - avctx->width;
 
     if (avpkt->side_data_elems > 0 &&
diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
index da22cc0..9cfcd14 100644
--- a/libavcodec/bfi.c
+++ b/libavcodec/bfi.c
@@ -58,10 +58,8 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
     uint32_t *pal;
     int i, j, ret, height = avctx->height;
 
-    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;
-    }
 
     bytestream2_init(&g, avpkt->data, buf_size);
 
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 5aeef2c..88a8d6e 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1184,15 +1184,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
     int bits_count = pkt->size << 3;
 
     if (c->version > 'b') {
-        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
             return ret;
-        }
     } else {
-        if ((ret = ff_reget_buffer(avctx, c->last)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+        if ((ret = ff_reget_buffer(avctx, c->last)) < 0)
             return ret;
-        }
         if ((ret = av_frame_ref(frame, c->last)) < 0)
             return ret;
     }
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 7de2c24..ef5569a 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -318,10 +318,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = s->frame_len;
-    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 (decode_block(s, (float **)frame->extended_data,
                      avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index fef2f23..a3bb1a7 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -196,10 +196,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c
index 78176f8..2628e4a 100644
--- a/libavcodec/bmv.c
+++ b/libavcodec/bmv.c
@@ -242,10 +242,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         scr_off = 0;
     }
 
-    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 (decode_bmv_frame(c->stream, pkt->size - (c->stream - pkt->data), c->frame, scr_off)) {
         av_log(avctx, AV_LOG_ERROR, "Error decoding frame data\n");
@@ -320,10 +318,8 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = total_blocks * 32;
-    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;
-    }
     output_samples = (int16_t *)frame->data[0];
 
     for (blocks = 0; blocks < total_blocks; blocks++) {
diff --git a/libavcodec/brender_pix.c b/libavcodec/brender_pix.c
index 67bec05..b30b882 100644
--- a/libavcodec/brender_pix.c
+++ b/libavcodec/brender_pix.c
@@ -134,10 +134,8 @@ static int brpix_decode_frame(AVCodecContext *avctx,
     if (hdr.width != avctx->width || hdr.height != avctx->height)
         avcodec_set_dimensions(avctx, hdr.width, hdr.height);
 
-    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;
-    }
 
     chunk_type = bytestream2_get_be32(&gb);
 
diff --git a/libavcodec/c93.c b/libavcodec/c93.c
index e7fbcc8..9aaa3ee 100644
--- a/libavcodec/c93.c
+++ b/libavcodec/c93.c
@@ -129,10 +129,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 
     c93->currentpic ^= 1;
 
-    if ((ret = ff_reget_buffer(avctx, newpic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, newpic)) < 0)
         return ret;
-    }
 
     stride = newpic->linesize[0];
 
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 8546e0b..a46ba83 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -260,10 +260,8 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_PATCHWELCOME;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
 
     if (encoding) {
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 02f16ec..181039c 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -439,10 +439,8 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
     s->data = buf;
     s->size = buf_size;
 
-    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
-    }
 
     if (s->palette_video) {
         const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
index 7d4fd68..2120864 100644
--- a/libavcodec/cljr.c
+++ b/libavcodec/cljr.c
@@ -52,10 +52,8 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c
index b22ee68..675f77d 100644
--- a/libavcodec/cngdec.c
+++ b/libavcodec/cngdec.c
@@ -142,10 +142,8 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
                                  p->excitation, avctx->frame_size, p->order);
 
     frame->nb_samples = avctx->frame_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;
-    }
     buf_out = (int16_t *)frame->data[0];
     for (i = 0; i < avctx->frame_size; i++)
         buf_out[i] = p->filter_out[i + p->order];
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index d9c4437..31b986c 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -970,10 +970,8 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
     /* get output buffer */
     if (q->discarded_packets >= 2) {
         frame->nb_samples = q->samples_per_channel;
-        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;
-        }
         samples = (float **)frame->extended_data;
     }
 
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index a29b651..4f83503 100644
--- a/libavcodec/cpia.c
+++ b/libavcodec/cpia.c
@@ -100,10 +100,8 @@ static int cpia_decode_frame(AVCodecContext *avctx,
     }
 
     // Get buffer filled with previous frame
-    if ((ret = ff_reget_buffer(avctx, frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed!\n");
+    if ((ret = ff_reget_buffer(avctx, frame)) < 0)
         return ret;
-    }
 
 
     for ( i = 0;
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index cc7fe95..0a5fa69 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -74,10 +74,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
         return ret;
-    }
 
     // decompress data
     switch ((buf[0] >> 1) & 7) {
diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c
index 8e45b3a..3a30138 100644
--- a/libavcodec/cyuv.c
+++ b/libavcodec/cyuv.c
@@ -105,10 +105,8 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
     /* pixel data starts 48 bytes in, after 3x16-byte tables */
     stream_ptr = 48;
 
-    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;
-    }
 
     y_plane = frame->data[0];
     u_plane = frame->data[1];
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index fd518a7..881f052 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2355,10 +2355,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 256 * (s->sample_blocks / 8);
-    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;
-    }
     samples_flt = (float **)frame->extended_data;
 
     /* allocate buffer for extra channels if downmixing */
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index e6325ed..402b0f9 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -211,10 +211,8 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = (out + avctx->channels - 1) / avctx->channels;
-    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;
-    }
     output_samples = (int16_t *)frame->data[0];
     samples_end = output_samples + out;
 
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index bcd72d2..0d60a7e 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -179,10 +179,8 @@ static int decode_frame(AVCodecContext *avctx,
             return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     // Move pointer to offset from start of file
     buf =  avpkt->data + offset;
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c
index 4f6b731..7090a17 100644
--- a/libavcodec/dsicinav.c
+++ b/libavcodec/dsicinav.c
@@ -363,10 +363,8 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = avpkt->size - cin->initial_decode_frame;
-    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;
-    }
     samples = (int16_t *)frame->data[0];
 
     delta = cin->delta;
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 5d9da00..2286f33 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -212,10 +212,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         pc = 1;
     }
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
     memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
     frame->palette_has_changed = pc;
 
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 78a4298..4e96c1a 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -188,10 +188,8 @@ static int cmv_decode_frame(AVCodecContext *avctx,
     if (av_image_check_size(s->width, s->height, 0, s->avctx))
         return -1;
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     memcpy(frame->data[1], s->palette, AVPALETTE_SIZE);
 
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 1e8d395..4555f0a 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -266,10 +266,8 @@ static int decode_frame(AVCodecContext *avctx,
         av_frame_unref(&s->last_frame);
     }
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
                           buf_end - buf);
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index cbf49a7..cf93c06 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -225,10 +225,8 @@ static int tgq_decode_frame(AVCodecContext *avctx,
     tgq_calculate_qtable(s, bytestream2_get_byteu(&s->gb));
     bytestream2_skip(&s->gb, 3);
 
-    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;
-    }
     frame->key_frame = 1;
     frame->pict_type = AV_PICTURE_TYPE_I;
 
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index 2c3e3ef..1484ddc 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -114,10 +114,8 @@ static int tqi_decode_frame(AVCodecContext *avctx,
     if (s->avctx->width!=s->width || s->avctx->height!=s->height)
         avcodec_set_dimensions(s->avctx, s->width, s->height);
 
-    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;
-    }
 
     av_fast_padded_malloc(&t->bitstream_buf, &t->bitstream_buf_size,
                           buf_end - buf);
diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index 3a4edec..3c83e58 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -271,10 +271,8 @@ static int escape124_decode_frame(AVCodecContext *avctx,
         }
     }
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     new_frame_data = (uint16_t*)frame->data[0];
     new_stride = frame->linesize[0] / 2;
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 72e5ef3..21afa1d 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -758,10 +758,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         p->key_frame = 0;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
         av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d slices:%d bps:%d\n",
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index f3f46e6..1d662f9 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -545,10 +545,8 @@ static int flac_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = s->blocksize;
-    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;
-    }
 
     s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, s->channels,
                                    s->blocksize, s->sample_shift);
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index a44e779..81628e6 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -337,10 +337,8 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
             s->image_width, s->image_height, s->block_width, s->block_height,
             h_blocks, v_blocks, h_part, v_part);
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     /* loop over all block columns */
     for (j = 0; j < v_blocks + (v_part ? 1 : 0); j++) {
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 27584cb..90885fc 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -185,10 +185,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
 
     bytestream2_init(&g2, buf, buf_size);
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     pixels = s->frame.data[0];
     pixel_limit = s->avctx->height * s->frame.linesize[0];
@@ -505,10 +503,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
 
     bytestream2_init(&g2, buf, buf_size);
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     pixels = s->frame.data[0];
     pixel_limit = s->avctx->height * s->frame.linesize[0];
diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
index b7d8ca8..b1c7408 100644
--- a/libavcodec/frwu.c
+++ b/libavcodec/frwu.c
@@ -59,10 +59,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
         return ret;
-    }
 
     pic->pict_type = AV_PICTURE_TYPE_I;
     pic->key_frame = 1;
diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
index 796db92..1a489a7 100644
--- a/libavcodec/g722dec.c
+++ b/libavcodec/g722dec.c
@@ -94,10 +94,8 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = avpkt->size * 2;
-    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;
-    }
     out_buf = (int16_t *)frame->data[0];
 
     init_get_bits(&gb, avpkt->data, avpkt->size * 8);
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index 7ee06c9..6254c9a 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -1185,10 +1185,8 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     frame->nb_samples = FRAME_LEN;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-         return ret;
-    }
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+        return ret;
 
     out = (int16_t *)frame->data[0];
 
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 38f91a0..4685e22 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -449,10 +449,8 @@ static int g726_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = out_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;
-    }
     samples = (int16_t *)frame->data[0];
 
     init_get_bits(&gb, buf, buf_size * 8);
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index c9af370..440bf80 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -420,10 +420,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
     int is_periodic = 0;         // whether one of the subframes is declared as periodic or not
 
     ctx->frame.nb_samples = SUBFRAME_SIZE<<1;
-    if ((ret = ff_get_buffer(avctx, &ctx->frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, &ctx->frame, 0)) < 0)
         return ret;
-    }
     out_frame = (int16_t*) ctx->frame.data[0];
 
     if (buf_size == 10) {
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 617e5b7..27364c9 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -469,10 +469,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
         avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
 
         av_frame_unref(s->frame);
-        if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
             return ret;
-        }
 
         av_fast_malloc(&s->idx_line, &s->idx_line_size, s->screen_width);
         if (!s->idx_line)
@@ -487,10 +485,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
             return AVERROR_INVALIDDATA;
         }
 
-        if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+        if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
             return ret;
-        }
 
         s->frame->pict_type = AV_PICTURE_TYPE_P;
         s->frame->key_frame = 0;
diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c
index 2db4bdd..dc64267 100644
--- a/libavcodec/gsmdec.c
+++ b/libavcodec/gsmdec.c
@@ -70,10 +70,8 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = avctx->frame_size;
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
         return res;
-    }
     samples = (int16_t *)frame->data[0];
 
     switch (avctx->codec_id) {
diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c
index 7e63da9..3596080 100644
--- a/libavcodec/idcinvideo.c
+++ b/libavcodec/idcinvideo.c
@@ -222,10 +222,8 @@ static int idcin_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_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 (idcin_decode_vlcs(s, frame))
         return AVERROR_INVALIDDATA;
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index dc70b9f..822a981 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -663,10 +663,8 @@ static int decode_frame(AVCodecContext *avctx,
 
     if ((res = extract_header(avctx, avpkt)) < 0)
         return res;
-    if ((res = ff_reget_buffer(avctx, s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((res = ff_reget_buffer(avctx, s->frame)) < 0)
         return res;
-    }
     if (!s->init && avctx->bits_per_coded_sample <= 8 &&
         avctx->pix_fmt == AV_PIX_FMT_PAL8) {
         if ((res = cmap_read_palette(avctx, (uint32_t*)s->frame->data[1])) < 0)
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 3647c80..4421586 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -979,10 +979,8 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
     bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
                      buf_size - s->decoding_map_size);
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     if (!s->is_16bpp) {
         const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index a3dfc0e..893b631 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -905,10 +905,8 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return buf_size;
 
     avcodec_set_dimensions(avctx, ctx->planes[0].width, ctx->planes[0].height);
-    if ((result = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((result = ff_get_buffer(avctx, frame, 0)) < 0)
         return result;
-    }
 
     if (ctx->is_scalable) {
         if (avctx->codec_id == AV_CODEC_ID_INDEO4)
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index 067845e..05c6d01 100644
--- a/libavcodec/jvdec.c
+++ b/libavcodec/jvdec.c
@@ -150,10 +150,8 @@ static int decode_frame(AVCodecContext *avctx,
             av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
             return AVERROR_INVALIDDATA;
         }
-        if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
             return ret;
-        }
 
         if (video_type == 0 || video_type == 1) {
             GetBitContext gb;
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index 2034ebd..20aae67 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -271,10 +271,8 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
 
     bytestream2_init(&ctx->g, avpkt->data, avpkt->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;
-    }
 
     header = bytestream2_get_byte(&ctx->g);
 
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index 45308cc..7948199 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -181,10 +181,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
     unsigned int mthread_inlen, mthread_outlen;
     unsigned int len = buf_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;
-    }
 
     outptr = frame->data[0]; // Output image pointer
 
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index 66fe0ae..a0559a7 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -207,10 +207,8 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = avctx->frame_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;
-    }
     samples = (int16_t *)frame->data[0];
 
     for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) {
diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c
index dd44beb..81057b4 100644
--- a/libavcodec/libilbc.c
+++ b/libavcodec/libilbc.c
@@ -93,10 +93,8 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     frame->nb_samples = s->decoder.blockl;
-    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;
-    }
 
     WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
                              (const WebRtc_UWord16*) buf, &s->decoder, 1);
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 5b8e8e6..eec847c 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -104,10 +104,8 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 160;
-    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;
-    }
 
     dec_mode    = (buf[0] >> 3) & 0x000F;
     packet_size = block_size[dec_mode] + 1;
@@ -343,10 +341,8 @@ static int amr_wb_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 320;
-    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;
-    }
 
     mode        = (buf[0] >> 3) & 0x000F;
     packet_size = block_size[mode];
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c
index 1544647..7c1ffa6 100644
--- a/libavcodec/libspeexdec.c
+++ b/libavcodec/libspeexdec.c
@@ -118,10 +118,8 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = s->frame_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;
-    }
     output = (int16_t *)frame->data[0];
 
     /* if there is not enough data left for the smallest possible frame or the
diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c
index e54e4b3..c4142cd 100644
--- a/libavcodec/libvorbisdec.c
+++ b/libavcodec/libvorbisdec.c
@@ -143,10 +143,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data,
     }
 
     frame->nb_samples = 8192*4;
-    if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0) {
-        av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0)
         return ret;
-    }
     output = (int16_t *)frame->data[0];
 
 
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 5019e7a..a77fd83 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -178,10 +178,8 @@ static int decode_frame(AVCodecContext *avctx,
     AVFrame * const p     = data;
     int decoded, ret;
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->key_frame = 1;
 
 #define ADVANCE_BY_DECODED do { \
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 4ac1af8..94bf2e7 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -246,10 +246,8 @@ static int mace_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 3 * (buf_size << (1 - is_mace3)) / avctx->channels;
-    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;
-    }
     samples = (int16_t **)frame->extended_data;
 
     for(i = 0; i < avctx->channels; i++) {
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 5473318..214ea45 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -1023,10 +1023,8 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
 
     /* get output buffer */
     frame->nb_samples = s->blockpos;
-    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;
-    }
     data_32 = (int32_t *)frame->data[0];
     data_16 = (int16_t *)frame->data[0];
 
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index d242b4b..bf47f65 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -188,10 +188,8 @@ static int mm_decode_frame(AVCodecContext *avctx,
     buf_size -= MM_PREAMBLE_SIZE;
     bytestream2_init(&s->gb, buf, buf_size);
 
-    if ((res = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((res = ff_reget_buffer(avctx, &s->frame)) < 0)
         return res;
-    }
 
     switch(type) {
     case MM_TYPE_PALETTE   : res = mm_decode_pal(s); return avpkt->size;
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 1d56245..00c1148 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -265,10 +265,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
     GetBitContext gb;
     int i, count1, count2, sz, ret;
 
-    if ((ret = ff_reget_buffer(avctx, &mp->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &mp->frame)) < 0)
         return ret;
-    }
 
     /* le32 bitstream msb first */
     av_fast_malloc(&mp->bswapbuf, &mp->bswapbuf_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index 26969b1..db37f5f 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -225,10 +225,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = MPC_FRAME_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;
-    }
 
     av_fast_padded_malloc(&c->bits, &c->buf_size, buf_size);
     if (!c->bits)
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index c7cf7fb..a05a72b 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -254,10 +254,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = MPC_FRAME_SIZE;
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
         return res;
-    }
 
     keyframe = c->cur_frame == 0;
 
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 763244d..f7fdeb5 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1628,10 +1628,8 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,
     if (!samples) {
         av_assert0(s->frame != NULL);
         s->frame->nb_samples = s->avctx->frame_size;
-        if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0)
             return ret;
-        }
         samples = (OUT_INT **)s->frame->extended_data;
     }
 
@@ -1935,10 +1933,8 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = MPA_FRAME_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;
-    }
     out_samples = (OUT_INT **)frame->extended_data;
 
     // Discard too short frames
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index ba38daa..674e586 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -92,10 +92,8 @@ static int msrle_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
         const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index b6cd425..e3cae92 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -151,10 +151,8 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     init_get_bits(&gb, buf, buf_size * 8);
     arith_init(&acoder, &gb);
 
-    if ((ret = ff_reget_buffer(avctx, &ctx->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &ctx->pic)) < 0)
         return ret;
-    }
 
     c->pal_pic    =  ctx->pic.data[0] + ctx->pic.linesize[0] * (avctx->height - 1);
     c->pal_stride = -ctx->pic.linesize[0];
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 7f10f9f..c432346 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -598,10 +598,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     if (c->mvX < 0 || c->mvY < 0) {
         FFSWAP(uint8_t *, c->pal_pic, c->last_pal_pic);
 
-        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
             return ret;
-        }
 
         if (ctx->last_pic.data[0]) {
             av_assert0(frame->linesize[0] == ctx->last_pic.linesize[0]);
@@ -612,10 +610,8 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             return AVERROR_INVALIDDATA;
         }
     } else {
-        if ((ret = ff_reget_buffer(avctx, &ctx->last_pic)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+        if ((ret = ff_reget_buffer(avctx, &ctx->last_pic)) < 0)
             return ret;
-        }
         if ((ret = av_frame_ref(frame, &ctx->last_pic)) < 0)
             return ret;
 
diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index 089b722..3cc484f 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -731,10 +731,8 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return buf_size;
     c->got_error = 0;
 
-    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0)
         return ret;
-    }
     c->pic.key_frame = keyframe;
     c->pic.pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
     if (!bytestream2_get_bytes_left(&gb)) {
diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 526c4c0..391805f 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -554,10 +554,8 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0)
         return ret;
-    }
     c->pic.key_frame = (frame_type == INTRA_FRAME);
     c->pic.pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I
                                                    : AV_PICTURE_TYPE_P;
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 2e1cb97..42110a2 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -171,10 +171,8 @@ static int decode_tag(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = NELLY_SAMPLES * blocks;
-    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;
-    }
     samples_flt = (float *)frame->data[0];
 
     for (i=0 ; i<blocks ; i++) {
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c
index 6743b1c..aec056a 100644
--- a/libavcodec/pcm-mpeg.c
+++ b/libavcodec/pcm-mpeg.c
@@ -153,10 +153,8 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = samples;
-    if ((retval = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((retval = ff_get_buffer(avctx, frame, 0)) < 0)
         return retval;
-    }
     dst16 = (int16_t *)frame->data[0];
     dst32 = (int32_t *)frame->data[0];
 
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 2cc14c1..83482dd 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -356,10 +356,8 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = n * samples_per_block / avctx->channels;
-    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;
-    }
     samples = frame->data[0];
 
     switch (avctx->codec_id) {
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index 9e94e4b..ba92332 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -131,10 +131,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return ret;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     p->pict_type = AV_PICTURE_TYPE_I;
 
diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index 8d7c009..8e6da75 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -146,10 +146,8 @@ static int decode_frame(AVCodecContext *avctx,
         avcodec_set_dimensions(avctx, s->width, s->height);
     }
 
-    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;
-    }
     memset(frame->data[0], 0, s->height * frame->linesize[0]);
     frame->pict_type           = AV_PICTURE_TYPE_I;
     frame->palette_has_changed = 1;
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index a34acf8..d0c7295 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -43,10 +43,8 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
     if ((ret = ff_pnm_decode_header(avctx, s)) < 0)
         return ret;
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c
index 93bb57d..740186b 100644
--- a/libavcodec/ptx.c
+++ b/libavcodec/ptx.c
@@ -59,10 +59,8 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return ret;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     p->pict_type = AV_PICTURE_TYPE_I;
 
diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c
index 3f482a9..ab95f2d 100644
--- a/libavcodec/qcelpdec.c
+++ b/libavcodec/qcelpdec.c
@@ -695,10 +695,8 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 160;
-    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;
-    }
     outbuffer = (float *)frame->data[0];
 
     if ((q->bitrate = determine_bitrate(avctx, buf_size, &buf)) == I_F_Q) {
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 6e313b4..977528e 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1985,10 +1985,8 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = 16 * s->frame_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;
-    }
     out = (int16_t *)frame->data[0];
 
     for (i = 0; i < 16; i++) {
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 96962dd..6970099 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -43,10 +43,8 @@ static int decode_frame(AVCodecContext *avctx,
     uint32_t *pal;
     int r, g, b;
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index 193e8c6..6015b7f 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -271,10 +271,8 @@ static int decode_frame(AVCodecContext *avctx,
     av_frame_unref(ref);
     av_frame_move_ref(ref, p);
 
-    if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
     outdata = a->pic.data[0];
     bytestream2_skip(&a->buffer, 4);
     bytestream2_get_buffer(&a->buffer, ctable, 128);
diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c
index 9cc054c..5c24704 100644
--- a/libavcodec/ra144dec.c
+++ b/libavcodec/ra144dec.c
@@ -78,10 +78,8 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = NBLOCKS * BLOCKSIZE;
-    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;
-    }
     samples = (int16_t *)frame->data[0];
 
     if(buf_size < FRAMESIZE) {
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 57602f1..7269783 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -198,10 +198,8 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME;
-    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;
-    }
     out = (float *)frame->data[0];
 
     init_get_bits(&gb, buf, avctx->block_align * 8);
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index 91c984f..041861d 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -460,10 +460,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
     }
 
     frame->nb_samples = ctx->max_frame_size;
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Me fail get_buffer()? That's unpossible!\n");
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
-    }
     samples0 = (int16_t *)frame->data[0];
     samples1 = (int16_t *)frame->data[1];
 
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 2309b0b..85fdab7 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -204,10 +204,8 @@ static int roq_decode_frame(AVCodecContext *avctx,
     int copy= !s->current_frame->data[0];
     int ret;
 
-    if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->current_frame)) < 0)
         return ret;
-    }
 
     if(copy)
         av_picture_copy((AVPicture*)s->current_frame, (AVPicture*)s->last_frame,
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index cce5b0d..2aa0091 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -256,10 +256,8 @@ static int rpza_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     rpza_decode_stream(s);
 
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index e61bbe7..5f73148 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -106,10 +106,8 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
     /* get output buffer */
     block_size = (avctx->bits_per_coded_sample + 4) / 4;
     frame->nb_samples = 2 * (buf_size / block_size) / avctx->channels;
-    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;
-    }
 
     buf_size = (frame->nb_samples * avctx->channels / 2) * block_size;
 
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 8268730..66ff522 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -1144,10 +1144,8 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
     int ret, dstpitch, height = ctx->height;
     int srcpitch = ctx->pitch * (hdr ? sizeof(ctx->frm0[0]) : 1);
 
-    if ((ret = ff_get_buffer(ctx->avctx, ctx->frame, 0)) < 0) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(ctx->avctx, ctx->frame, 0)) < 0)
         return ret;
-    }
 
     dst      = ctx->frame->data[0];
     dstpitch = ctx->frame->linesize[0];
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index c84a57c..1d3b6eb 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -596,10 +596,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
 
                 /* get output buffer */
                 frame->nb_samples = s->blocksize;
-                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;
-                }
 
                 for (chan = 0; chan < s->channels; chan++) {
                     samples_u8  = ((uint8_t **)frame->extended_data)[chan];
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index 41c1197..35e8bf5 100644
--- a/libavcodec/sipr.c
+++ b/libavcodec/sipr.c
@@ -543,10 +543,8 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *data,
     /* get output buffer */
     frame->nb_samples = mode_par->frames_per_packet * subframe_size *
                         mode_par->subframe_count;
-    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;
-    }
     samples = (float *)frame->data[0];
 
     init_get_bits(&gb, buf, mode_par->bits_per_frame);
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 3530033..c070150 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -381,10 +381,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     if (avpkt->size <= 769)
         return AVERROR_INVALIDDATA;
 
-    if ((ret = ff_reget_buffer(avctx, &smk->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &smk->pic)) < 0)
         return ret;
-    }
 
     /* make the palette available on the way out */
     pal = (uint32_t*)smk->pic.data[1];
@@ -634,10 +632,8 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = unp_size / (avctx->channels * (bits + 1));
-    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;
-    }
     samples  = (int16_t *)frame->data[0];
     samples8 =            frame->data[0];
 
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 126acf3..c98b069 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -471,10 +471,9 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
     int ret, emu_buf_size;
 
     if(!s->scratchbuf) {
-        if ((ret = ff_get_buffer(s->avctx, &s->mconly_picture, AV_GET_BUFFER_FLAG_REF)) < 0) {
-            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_get_buffer(s->avctx, &s->mconly_picture,
+                                 AV_GET_BUFFER_FLAG_REF)) < 0)
             return ret;
-        }
         FF_ALLOCZ_OR_GOTO(avctx, s->scratchbuf, FFMAX(s->mconly_picture.linesize[0], 2*avctx->width+256)*7*MB_SIZE, fail);
         emu_buf_size = FFMAX(s->mconly_picture.linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1);
         FF_ALLOC_OR_GOTO(avctx, s->emu_edge_buffer, emu_buf_size, fail);
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 7f11ca7..fe9f01f 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -877,10 +877,8 @@ static int sonic_decode_frame(AVCodecContext *avctx,
     if (buf_size == 0) return 0;
 
     s->frame.nb_samples = s->frame_size;
-    if ((ret = ff_get_buffer(avctx, &s->frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, &s->frame, 0)) < 0)
         return ret;
-    }
     samples = (int16_t *)s->frame.data[0];
 
 //    av_log(NULL, AV_LOG_INFO, "buf_size: %d\n", buf_size);
diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c
index 533ff62..6ea8fbc 100644
--- a/libavcodec/sunrast.c
+++ b/libavcodec/sunrast.c
@@ -102,10 +102,8 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
 
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     p->pict_type = AV_PICTURE_TYPE_I;
 
diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 9601a27..ff4390f 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -177,10 +177,8 @@ static int decode_frame(AVCodecContext *avctx,
         return ret;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     if (flags & TGA_TOPTOBOTTOM) {
         dst = p->data[0];
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index b749a6b..6c5f49c 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -642,10 +642,8 @@ static int init_image(TiffContext *s, AVFrame *frame)
             return ret;
         avcodec_set_dimensions(s->avctx, s->width, s->height);
     }
-    if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0)
         return ret;
-    }
     if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
         if (s->palette_is_set) {
             memcpy(frame->data[1], s->palette, sizeof(s->palette));
diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c
index 2e6a22b..279298c 100644
--- a/libavcodec/tmv.c
+++ b/libavcodec/tmv.c
@@ -46,10 +46,8 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data,
     unsigned x, y, fg, bg, c;
     int ret;
 
-    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 (avpkt->size < 2*char_rows*char_cols) {
         av_log(avctx, AV_LOG_ERROR,
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 6918a17..13b9723 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -868,10 +868,8 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR(ENOMEM);
     }
 
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, p)) < 0)
         return ret;
-    }
 
     l->dsp.bswap_buf((uint32_t*)l->buffer, (const uint32_t*)buf, buf_size >> 2);
 
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 67d77fd..3ed4dec 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -325,10 +325,8 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = iterations * 240;
-    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;
-    }
     samples = (int16_t *)frame->data[0];
 
     memset(samples, 0, iterations * 240 * sizeof(*samples));
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index d907241..6e1e077 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -73,10 +73,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     int zret; // Zlib return code
     int ret, len = buf_size;
 
-    if ((ret = ff_reget_buffer(avctx, frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, frame)) < 0)
         return ret;
-    }
 
     zret = inflateReset(&c->zstream);
     if (zret != Z_OK) {
diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c
index f87ab40..f275ff9 100644
--- a/libavcodec/tscc2.c
+++ b/libavcodec/tscc2.c
@@ -230,10 +230,8 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0)
         return ret;
-    }
 
     if (frame_type == 0) {
         *got_frame      = 1;
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 0d10750..8b4ca5a 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -334,10 +334,8 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = framelen;
-    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;
-    }
 
     // decode directly to output buffer for 24-bit sample format
     if (s->bps == 3)
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index 8cd6ccf..8b9c79f 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -832,10 +832,8 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
     /* get output buffer */
     if (tctx->discarded_packets >= 2) {
         frame->nb_samples = mtab->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;
-        }
         out = (float **)frame->extended_data;
     }
 
diff --git a/libavcodec/txd.c b/libavcodec/txd.c
index a51d766..e8d483f 100644
--- a/libavcodec/txd.c
+++ b/libavcodec/txd.c
@@ -67,10 +67,8 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return ret;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     p->pict_type = AV_PICTURE_TYPE_I;
 
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c
index 84337c6..2120d97 100644
--- a/libavcodec/ulti.c
+++ b/libavcodec/ulti.c
@@ -227,10 +227,8 @@ static int ulti_decode_frame(AVCodecContext *avctx,
     int skip;
     int tmp;
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     bytestream2_init(&s->gb, buf, buf_size);
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 9085dfe..65e7a1b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -653,7 +653,7 @@ static void compat_release_buffer(void *opaque, uint8_t *data)
 }
 #endif
 
-int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
+static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
 {
     int ret;
 
@@ -775,7 +775,15 @@ fail:
     return avctx->get_buffer2(avctx, frame, flags);
 }
 
-int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
+int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
+{
+    int ret = get_buffer_internal(avctx, frame, flags);
+    if (ret < 0)
+        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    return ret;
+}
+
+static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
 {
     AVFrame tmp;
     int ret;
@@ -812,6 +820,14 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
     return 0;
 }
 
+int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
+{
+    int ret = reget_buffer_internal(avctx, frame);
+    if (ret < 0)
+        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    return ret;
+}
+
 #if FF_API_GET_BUFFER
 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
 {
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index ebb06f5..29cd104 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -197,10 +197,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
     bytestream2_init(&c->stream, avpkt->data, avpkt->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;
-    }
 
     flags = bytestream2_get_le16(&c->stream);
 
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index 6ef7165..e9c988e 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -59,10 +59,8 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR(EINVAL);
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/vima.c b/libavcodec/vima.c
index 658c6ce..705839e 100644
--- a/libavcodec/vima.c
+++ b/libavcodec/vima.c
@@ -170,10 +170,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     }
 
     frame->nb_samples = 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;
-    }
 
     for (chan = 0; chan < channels; chan++) {
         uint16_t *dest = (uint16_t*)frame->data[0] + chan;
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index e8574c1..c4081f8 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -597,10 +597,8 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
     /* get output buffer */
     frame->nb_samples = ((silent_chunks + audio_chunks) * avctx->block_align) /
                         avctx->channels;
-    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;
-    }
     output_samples_u8  =            frame->data[0];
     output_samples_s16 = (int16_t *)frame->data[0];
 
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index 769b40a..99571a1 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -296,10 +296,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     const uint8_t *src = buf;
     int dx, dy, w, h, depth, enc, chunks, res, size_left, ret;
 
-    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0)
         return ret;
-    }
 
     c->pic.key_frame = 0;
     c->pic.pict_type = AV_PICTURE_TYPE_P;
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 581b7bc..7a71797 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1729,10 +1729,8 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = vc->blocksize[1] / 2;
-    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 (vc->audio_channels > 8) {
         for (i = 0; i < vc->audio_channels; i++)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index c9a908f..b30b414 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1216,10 +1216,8 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = s->samples + 1;
-    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;
-    }
     frame->nb_samples = s->samples;
 
     while (buf_size > 0) {
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 2774dc9..9be8600 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -837,10 +837,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = nb_frames * s->frame_len;
-    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;
-    }
     samples = (float **)frame->extended_data;
     samples_offset = 0;
 
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index ecd5b4a..970902b 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -1799,10 +1799,8 @@ static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
 
     /* get output buffer */
     frame->nb_samples = 480;
-    if ((res = ff_get_buffer(ctx, frame, 0)) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((res = ff_get_buffer(ctx, frame, 0)) < 0)
         return res;
-    }
     frame->nb_samples = n_samples;
     samples = (float *)frame->data[0];
 
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index d4e866f..d27df75 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -81,10 +81,8 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = out_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;
-    }
     samples     = frame->data[0];
     samples_end = samples + out_size;
 
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index d5d774d..f50b650 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -59,10 +59,8 @@ static int decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
 
diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c
index 03f7f40..c47c3eb 100644
--- a/libavcodec/xwddec.c
+++ b/libavcodec/xwddec.c
@@ -199,10 +199,8 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_PATCHWELCOME;
     }
 
-    if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    }
 
     p->key_frame = 1;
     p->pict_type = AV_PICTURE_TYPE_I;
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 3852933..446a4ea 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -508,10 +508,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         return AVERROR_INVALIDDATA;
     }
 
-    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 (c->comp == 0) { //Uncompressed data
         if (c->decomp_size < len) {
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list