[FFmpeg-devel] [PATCHv2] lavc: factorize ff_{thread_, re, }get_buffer error messages.

Clément Bœsch ubitux at gmail.com
Tue Mar 12 11:24:02 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;

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

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

...along with some manual patches for the remaining ones.
---
Changes from previous version:
 - back to return -1 in vp56: the res variable was being used for something
   else. I've re-checked every single entry in case I did the same mistake
   elsewhere
 - squashed the two patches
 - various trivial changes
---
 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         |  4 +---
 libavcodec/amrwbdec.c         |  4 +---
 libavcodec/anm.c              |  4 +---
 libavcodec/ansi.c             | 11 +++--------
 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/bintext.c          |  6 ++----
 libavcodec/bmp.c              |  4 +---
 libavcodec/bmv.c              |  8 ++------
 libavcodec/brender_pix.c      |  4 +---
 libavcodec/c93.c              |  4 +---
 libavcodec/cdgraphics.c       | 10 ++--------
 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/crystalhd.c        |  4 +---
 libavcodec/cscd.c             |  4 +---
 libavcodec/cyuv.c             |  4 +---
 libavcodec/dcadec.c           |  4 +---
 libavcodec/dfa.c              |  4 +---
 libavcodec/diracdec.c         |  8 +++-----
 libavcodec/dnxhddec.c         |  4 +---
 libavcodec/dpcm.c             |  4 +---
 libavcodec/dpx.c              |  4 +---
 libavcodec/dsicinav.c         |  4 +---
 libavcodec/dvdec.c            |  8 +++-----
 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/escape130.c        |  6 ++----
 libavcodec/exr.c              |  4 +---
 libavcodec/ffv1dec.c          |  4 +---
 libavcodec/flacdec.c          |  4 +---
 libavcodec/flashsv.c          |  4 +---
 libavcodec/flicvideo.c        |  8 ++------
 libavcodec/fraps.c            |  4 +---
 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/huffyuvdec.c       |  4 +---
 libavcodec/idcinvideo.c       |  4 +---
 libavcodec/iff.c              |  4 +---
 libavcodec/imc.c              |  4 +---
 libavcodec/indeo2.c           |  4 +---
 libavcodec/indeo3.c           |  4 +---
 libavcodec/interplayvideo.c   |  4 +---
 libavcodec/ivi_common.c       |  4 +---
 libavcodec/jvdec.c            |  4 +---
 libavcodec/kmvc.c             |  4 +---
 libavcodec/lagarith.c         | 16 ++++------------
 libavcodec/lcldec.c           |  4 +---
 libavcodec/libcelt_dec.c      |  5 +----
 libavcodec/libgsm.c           |  4 +---
 libavcodec/libilbc.c          |  4 +---
 libavcodec/libopencore-amr.c  |  8 ++------
 libavcodec/libopenjpegdec.c   |  4 +---
 libavcodec/libopusdec.c       |  5 +----
 libavcodec/libspeexdec.c      |  4 +---
 libavcodec/libstagefright.cpp |  1 -
 libavcodec/libvorbisdec.c     |  4 +---
 libavcodec/loco.c             |  4 +---
 libavcodec/mace.c             |  4 +---
 libavcodec/mdec.c             |  4 +---
 libavcodec/mimic.c            |  4 +---
 libavcodec/mjpegdec.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/msvideo1.c         |  4 +---
 libavcodec/mvcdec.c           |  7 ++-----
 libavcodec/mxpegdec.c         | 16 ++++++----------
 libavcodec/nellymoserdec.c    |  4 +---
 libavcodec/nuv.c              |  5 +----
 libavcodec/pcm-mpeg.c         |  4 +---
 libavcodec/pcm.c              |  4 +---
 libavcodec/pcx.c              |  4 +---
 libavcodec/pictordec.c        |  4 +---
 libavcodec/pngdec.c           |  4 +---
 libavcodec/pnmdec.c           |  4 +---
 libavcodec/pthread.c          | 10 +++++++++-
 libavcodec/ptx.c              |  4 +---
 libavcodec/qcelpdec.c         |  4 +---
 libavcodec/qdm2.c             |  4 +---
 libavcodec/qdrw.c             |  4 +---
 libavcodec/qpeg.c             |  4 +---
 libavcodec/qtrle.c            |  4 +---
 libavcodec/ra144dec.c         |  4 +---
 libavcodec/ra288.c            |  4 +---
 libavcodec/ralf.c             |  4 +---
 libavcodec/rl2.c              |  4 +---
 libavcodec/roqvideodec.c      |  4 +---
 libavcodec/roqvideoenc.c      |  8 +++-----
 libavcodec/rpza.c             |  4 +---
 libavcodec/s302m.c            |  4 +---
 libavcodec/sanm.c             |  4 +---
 libavcodec/sgidec.c           |  6 ++----
 libavcodec/sgirledec.c        |  5 +----
 libavcodec/shorten.c          |  4 +---
 libavcodec/sipr.c             |  4 +---
 libavcodec/smacker.c          |  8 ++------
 libavcodec/smc.c              |  4 +---
 libavcodec/snow.c             | 13 +++++--------
 libavcodec/sonic.c            |  4 +---
 libavcodec/sunrast.c          |  4 +---
 libavcodec/targa.c            |  4 +---
 libavcodec/tiertexseqv.c      |  4 +---
 libavcodec/tiff.c             |  4 +---
 libavcodec/tmv.c              |  4 +---
 libavcodec/truemotion1.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/utvideodec.c       |  4 +---
 libavcodec/vb.c               |  4 +---
 libavcodec/vc1dec.c           |  7 +++----
 libavcodec/vcr1.c             |  4 +---
 libavcodec/vima.c             |  4 +---
 libavcodec/vmdav.c            |  8 ++------
 libavcodec/vmnc.c             |  4 +---
 libavcodec/vorbisdec.c        |  4 +---
 libavcodec/vp3.c              |  8 ++------
 libavcodec/vp56.c             |  4 +---
 libavcodec/vp8.c              |  4 +---
 libavcodec/vqavideo.c         |  4 +---
 libavcodec/wavpack.c          |  4 +---
 libavcodec/wmadec.c           |  4 +---
 libavcodec/wmaprodec.c        |  1 -
 libavcodec/wmavoice.c         |  4 +---
 libavcodec/wnv1.c             |  1 -
 libavcodec/ws-snd1.c          |  4 +---
 libavcodec/xan.c              |  4 +---
 libavcodec/xl.c               |  4 +---
 libavcodec/xwddec.c           |  4 +---
 libavcodec/xxan.c             |  4 +---
 libavcodec/yop.c              |  5 +----
 libavcodec/zmbv.c             |  4 +---
 179 files changed, 240 insertions(+), 610 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..e1773aa 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");
+    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/ansi.c b/libavcodec/ansi.c
index 621f095..f259852 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -246,11 +246,9 @@ static int execute_code(AVCodecContext * avctx, int c)
         if (width != avctx->width || height != avctx->height) {
             av_frame_unref(s->frame);
             avcodec_set_dimensions(avctx, width, height);
-            ret = ff_get_buffer(avctx, s->frame, AV_GET_BUFFER_FLAG_REF);
-            if (ret < 0) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+            if ((ret = ff_get_buffer(avctx, s->frame,
+                                     AV_GET_BUFFER_FLAG_REF)) < 0)
                 return ret;
-            }
             s->frame->pict_type           = AV_PICTURE_TYPE_I;
             s->frame->palette_has_changed = 1;
             set_palette((uint32_t *)s->frame->data[1]);
@@ -351,11 +349,8 @@ static int decode_frame(AVCodecContext *avctx,
     const uint8_t *buf_end   = buf+buf_size;
     int ret, i, count;
 
-    ret = ff_reget_buffer(avctx, s->frame);
-    if (ret < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
-    }
     if (!avctx->frame_number) {
         for (i=0; i<avctx->height; i++)
             memset(s->frame->data[0]+ i*s->frame->linesize[0], 0, avctx->width);
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/bintext.c b/libavcodec/bintext.c
index b6d7d0f..f8059aa 100644
--- a/libavcodec/bintext.c
+++ b/libavcodec/bintext.c
@@ -144,10 +144,8 @@ static int decode_frame(AVCodecContext *avctx,
     int ret;
 
     s->x = s->y = 0;
-    if (ff_reget_buffer(avctx, s->frame) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+        return ret;
     s->frame->pict_type           = AV_PICTURE_TYPE_I;
     s->frame->palette_has_changed = 1;
     memcpy(s->frame->data[1], s->palette, 16 * 4);
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/cdgraphics.c b/libavcodec/cdgraphics.c
index f380dcd..d22e9f6 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -278,11 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
         return AVERROR(EINVAL);
     }
 
-    ret = ff_reget_buffer(avctx, cc->frame);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
         return ret;
-    }
     if (!avctx->frame_number) {
         memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
         memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
@@ -333,11 +330,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
                 return AVERROR(EINVAL);
             }
 
-            ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
-            if (ret) {
-                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;
-            }
 
             cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
             av_frame_unref(cc->frame);
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/crystalhd.c b/libavcodec/crystalhd.c
index 3e9b62b..94d3051 100644
--- a/libavcodec/crystalhd.c
+++ b/libavcodec/crystalhd.c
@@ -643,10 +643,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
     priv->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                              FF_BUFFER_HINTS_REUSABLE;
     if (!priv->pic.data[0]) {
-        if (ff_get_buffer(avctx, &priv->pic, 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if (ff_get_buffer(avctx, &priv->pic, 0) < 0)
             return RET_ERROR;
-        }
     }
 
     bwidth = av_image_get_linesize(avctx->pix_fmt, width, 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/dfa.c b/libavcodec/dfa.c
index a2f18ae..b20cd0e 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -324,10 +324,8 @@ static int dfa_decode_frame(AVCodecContext *avctx,
     int ret;
     int i, pal_elems;
 
-    if ((ret = ff_get_buffer(avctx, frame, 0))) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
-    }
 
     bytestream2_init(&gb, avpkt->data, avpkt->size);
     while (bytestream2_get_bytes_left(&gb) > 0) {
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index aa158bf..81d2b65 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1747,7 +1747,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
 {
     DiracContext *s   = avctx->priv_data;
     DiracFrame *pic   = NULL;
-    int i, parse_code = buf[4];
+    int ret, i, parse_code = buf[4];
     unsigned tmp;
 
     if (size < DATA_UNIT_HEADER_SIZE)
@@ -1811,10 +1811,8 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
         pic->avframe.key_frame = s->num_refs == 0;             /* [DIRAC_STD] is_intra()      */
         pic->avframe.pict_type = s->num_refs + 1;              /* Definition of AVPictureType in avutil.h */
 
-        if (ff_get_buffer(avctx, &pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-            return -1;
-        }
+        if ((ret = ff_get_buffer(avctx, &pic->avframe, (parse_code & 0x0C) == 0x0C ? AV_GET_BUFFER_FLAG_REF : 0)) < 0)
+            return ret;
         s->current_picture = pic;
         s->plane[0].stride = pic->avframe.linesize[0];
         s->plane[1].stride = pic->avframe.linesize[1];
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1992119..11bed00 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -385,10 +385,8 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     avcodec_set_dimensions(avctx, ctx->width, ctx->height);
 
     if (first_field) {
-        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
             return ret;
-        }
         picture->pict_type = AV_PICTURE_TYPE_I;
         picture->key_frame = 1;
     }
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/dvdec.c b/libavcodec/dvdec.c
index 51e32b5..5cc205c 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -319,7 +319,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
     int buf_size = avpkt->size;
     DVVideoContext *s = avctx->priv_data;
     const uint8_t* vsc_pack;
-    int apt, is16_9;
+    int ret, apt, is16_9;
 
     s->sys = avpriv_dv_frame_profile2(avctx, s->sys, buf, buf_size);
     if (!s->sys || buf_size < s->sys->frame_size || ff_dv_init_dynamic_tables(s->sys)) {
@@ -332,10 +332,8 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
     avctx->pix_fmt   = s->sys->pix_fmt;
     avctx->time_base = s->sys->time_base;
     avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);
-    if (ff_get_buffer(avctx, &s->picture, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
+    if ((ret = ff_get_buffer(avctx, &s->picture, 0)) < 0)
+        return ret;
     s->picture.interlaced_frame = 1;
     s->picture.top_field_first  = 0;
 
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/escape130.c b/libavcodec/escape130.c
index 64d2383..d24af79 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -131,10 +131,8 @@ static int escape130_decode_frame(AVCodecContext *avctx,
     // Header; no useful information in here
     skip_bits_long(&gb, 128);
 
-    if (ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
+        return ret;
 
     new_y = frame->data[0];
     new_cb = frame->data[1];
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index cc0995c..1c2aa42 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -754,10 +754,8 @@ static int decode_frame(AVCodecContext *avctx,
         memset(s->thread_data + prev_size, 0, s->thread_data_size - prev_size);
     }
 
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
-    }
 
     if (buf_end - buf < scan_line_blocks * 8)
         return AVERROR_INVALIDDATA;
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/fraps.c b/libavcodec/fraps.c
index f80b41e..00a38c6 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -201,10 +201,8 @@ static int decode_frame(AVCodecContext *avctx,
 
     avctx->pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
 
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0))) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
-    }
 
     switch (version) {
     case 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/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 8554ecf..e5a9e3b 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -523,10 +523,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer,
                      (const uint32_t*)buf, buf_size / 4);
 
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
-    }
 
     if (s->context) {
         table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
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/imc.c b/libavcodec/imc.c
index 2d7dd63..bdeef04 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -948,10 +948,8 @@ static int imc_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = COEFFS;
-    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 (i = 0; i < avctx->channels; i++) {
         q->out_samples = (float *)frame->extended_data[i];
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 0ce65b1..f8e7415 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -149,10 +149,8 @@ static int ir2_decode_frame(AVCodecContext *avctx,
     AVFrame * const p    = &s->picture;
     int start, ret;
 
-    if ((ret = ff_reget_buffer(avctx, p)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, p)) < 0)
         return ret;
-    }
 
     start = 48; /* hardcoded for now */
 
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index fd302a7..29f2195 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -1088,10 +1088,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     /* use BS_BUFFER flag for buffer switching */
     ctx->buf_sel = (ctx->frame_flags >> BS_BUFFER) & 1;
 
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
         return res;
-    }
 
     /* decode luma plane */
     if ((res = decode_plane(ctx, avctx, ctx->planes, ctx->y_data_ptr, ctx->y_data_size, 40)))
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/lagarith.c b/libavcodec/lagarith.c
index 200cbdc..8599784 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -539,10 +539,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
                 planes = 4;
             }
 
-        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
             return ret;
-        }
 
         dst = p->data[0];
         if (frametype == FRAME_SOLID_RGBA) {
@@ -568,10 +566,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
         if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)
             avctx->pix_fmt = AV_PIX_FMT_RGB24;
 
-        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
             return ret;
-        }
 
         offs[0] = offset_bv;
         offs[1] = offset_gu;
@@ -627,10 +623,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
     case FRAME_ARITH_YUY2:
         avctx->pix_fmt = AV_PIX_FMT_YUV422P;
 
-        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
             return ret;
-        }
 
         if (offset_ry >= buf_size ||
             offset_gu >= buf_size ||
@@ -653,10 +647,8 @@ static int lag_decode_frame(AVCodecContext *avctx,
     case FRAME_ARITH_YV12:
         avctx->pix_fmt = AV_PIX_FMT_YUV420P;
 
-        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
             return ret;
-        }
         if (buf_size <= offset_ry || buf_size <= offset_gu || buf_size <= offset_bv) {
             return AVERROR_INVALIDDATA;
         }
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/libcelt_dec.c b/libavcodec/libcelt_dec.c
index 496b95a..53bbb72 100644
--- a/libavcodec/libcelt_dec.c
+++ b/libavcodec/libcelt_dec.c
@@ -111,11 +111,8 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data,
     int16_t *pcm;
 
     frame->nb_samples = c->frame_size;
-    err = ff_get_buffer(c, frame, 0);
-    if (err < 0) {
-        av_log(c, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((err = ff_get_buffer(c, frame, 0)) < 0)
         return err;
-    }
     pcm = (int16_t *)frame->data[0];
     err = celt_decode(celt->dec, pkt->data, pkt->size, pcm, c->frame_size);
     if (err < 0)
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/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 5476e0a..f8b6165 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -310,10 +310,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
         if (image->comps[i].prec > avctx->bits_per_raw_sample)
             avctx->bits_per_raw_sample = image->comps[i].prec;
 
-    if (ff_thread_get_buffer(avctx, &frame, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "ff_thread_get_buffer() failed\n");
+    if (ff_thread_get_buffer(avctx, &frame, 0) < 0)
         goto done;
-    }
 
     ctx->dec_params.cp_limit_decoding = NO_LIMITATION;
     ctx->dec_params.cp_reduce = avctx->lowres;
diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
index 71078c4..9b5cfe7 100644
--- a/libavcodec/libopusdec.c
+++ b/libavcodec/libopusdec.c
@@ -132,11 +132,8 @@ static int libopus_decode(AVCodecContext *avc, void *data,
     int ret, nb_samples;
 
     frame->nb_samples = MAX_FRAME_SIZE;
-    ret = ff_get_buffer(avc, frame, 0);
-    if (ret < 0) {
-        av_log(avc, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avc, frame, 0)) < 0)
         return ret;
-    }
 
     if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
         nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
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/libstagefright.cpp b/libavcodec/libstagefright.cpp
index 4c270b0..a6fd1b9 100644
--- a/libavcodec/libstagefright.cpp
+++ b/libavcodec/libstagefright.cpp
@@ -187,7 +187,6 @@ void* decode_thread(void *arg)
             }
             ret = ff_get_buffer(avctx, frame->vframe);
             if (ret < 0) {
-                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                 frame->status = ret;
                 decode_done   = 1;
                 buffer->release();
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/mdec.c b/libavcodec/mdec.c
index 561c2ed..8fb29ce 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -165,10 +165,8 @@ static int decode_frame(AVCodecContext *avctx,
     ThreadFrame frame     = { .f = data };
     int i, ret;
 
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
-    }
     frame.f->pict_type = AV_PICTURE_TYPE_I;
     frame.f->key_frame = 1;
 
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 90e3969..db78751 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -402,10 +402,8 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
     ctx->frames[ctx->cur_index].f->pict_type = is_pframe ? AV_PICTURE_TYPE_P :
                                                            AV_PICTURE_TYPE_I;
     if ((res = ff_thread_get_buffer(avctx, &ctx->frames[ctx->cur_index],
-                                    AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+                                    AV_GET_BUFFER_FLAG_REF)) < 0)
         return res;
-    }
 
     ctx->next_prev_index = ctx->cur_index;
     ctx->next_cur_index  = (ctx->cur_index - 1) & 15;
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 2f75194..76d9e7e 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -442,10 +442,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     }
 
     av_frame_unref(s->picture_ptr);
-    if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
         return -1;
-    }
     s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
     s->picture_ptr->key_frame = 1;
     s->got_picture            = 1;
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/msvideo1.c b/libavcodec/msvideo1.c
index afaa7ae..c5a1daa 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -298,10 +298,8 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     if (s->mode_8bit) {
         const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c
index 7848d32..54e9757 100644
--- a/libavcodec/mvcdec.c
+++ b/libavcodec/mvcdec.c
@@ -230,11 +230,8 @@ static int mvc_decode_frame(AVCodecContext *avctx,
     GetByteContext gb;
     int ret;
 
-    ret = ff_reget_buffer(avctx, s->frame);
-    if (ret < 0) {
-        av_log (avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return AVERROR(ENOMEM);
-    }
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+        return ret;
 
     bytestream2_init(&gb, avpkt->data, avpkt->size);
     if (avctx->codec_id == AV_CODEC_ID_MVC1)
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 5b72d42..0069ca5 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -248,11 +248,9 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
                     }
                     /* use stored SOF data to allocate current picture */
                     av_frame_unref(jpg->picture_ptr);
-                    if (ff_get_buffer(avctx, jpg->picture_ptr,
-                                      AV_GET_BUFFER_FLAG_REF) < 0) {
-                        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                        return AVERROR(ENOMEM);
-                    }
+                    if ((ret = ff_get_buffer(avctx, jpg->picture_ptr,
+                                             AV_GET_BUFFER_FLAG_REF)) < 0)
+                        return ret;
                     jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
                     jpg->picture_ptr->key_frame = 0;
                     jpg->got_picture = 1;
@@ -268,11 +266,9 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
 
                     /* allocate dummy reference picture if needed */
                     if (!reference_ptr->data[0] &&
-                        ff_get_buffer(avctx, reference_ptr,
-                                      AV_GET_BUFFER_FLAG_REF) < 0) {
-                        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-                        return AVERROR(ENOMEM);
-                    }
+                        (ret = ff_get_buffer(avctx, reference_ptr,
+                                             AV_GET_BUFFER_FLAG_REF)) < 0)
+                        return ret;
 
                     ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
                     if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
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/nuv.c b/libavcodec/nuv.c
index 48348ea..edf777e 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -246,11 +246,8 @@ retry:
         init_frame = 1;
     }
 
-    result = ff_reget_buffer(avctx, &c->pic);
-    if (result < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((result = ff_reget_buffer(avctx, &c->pic)) < 0)
         return result;
-    }
     if (init_frame) {
         memset(c->pic.data[0], 0,    avctx->height * c->pic.linesize[0]);
         memset(c->pic.data[1], 0x80, avctx->height * c->pic.linesize[1] / 2);
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/pngdec.c b/libavcodec/pngdec.c
index 564baaf..086f3b41 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -637,10 +637,8 @@ static int decode_frame(AVCodecContext *avctx,
                     goto fail;
                 }
 
-                if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
-                    av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+                if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0)
                     goto fail;
-                }
                 p->pict_type        = AV_PICTURE_TYPE_I;
                 p->key_frame        = 1;
                 p->interlaced_frame = !!s->interlace_type;
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/pthread.c b/libavcodec/pthread.c
index 5903e09..67592f4 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -940,7 +940,7 @@ int ff_thread_can_start_frame(AVCodecContext *avctx)
     return 1;
 }
 
-int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
+static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int flags)
 {
     PerThreadContext *p = avctx->thread_opaque;
     int err;
@@ -1004,6 +1004,14 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
     return err;
 }
 
+int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
+{
+    int ret = thread_get_buffer_internal(avctx, f, flags);
+    if (ret < 0)
+        av_log(avctx, AV_LOG_ERROR, "thread_get_buffer() failed\n");
+    return ret;
+}
+
 void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
 {
     PerThreadContext *p = avctx->thread_opaque;
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/qtrle.c b/libavcodec/qtrle.c
index 60b2029..c043249 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -412,10 +412,8 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
     int ret;
 
     bytestream2_init(&s->g, avpkt->data, avpkt->size);
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     /* check if this frame is even supposed to change */
     if (avpkt->size < 8)
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/rl2.c b/libavcodec/rl2.c
index 5a8064b..c8853de 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -181,10 +181,8 @@ static int rl2_decode_frame(AVCodecContext *avctx,
     int ret, buf_size  = avpkt->size;
     Rl2Context *s = avctx->priv_data;
 
-    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
-    }
 
     /** run length decode */
     rl2_rle_decode(s, buf, buf_size, frame->data[0], frame->linesize[0],
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/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 187b848..a652c47 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1051,11 +1051,9 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     if (enc->first_frame) {
         /* Alloc memory for the reconstruction data (we must know the stride
          for that) */
-        if (ff_get_buffer(avctx, enc->current_frame, 0) ||
-            ff_get_buffer(avctx, enc->last_frame, 0)) {
-            av_log(avctx, AV_LOG_ERROR, "  RoQ: get_buffer() failed\n");
-            return -1;
-        }
+        if ((ret = ff_get_buffer(avctx, enc->current_frame, 0)) < 0 ||
+            (ret = ff_get_buffer(avctx, enc->last_frame,    0)) < 0)
+            return ret;
 
         /* Before the first video frame, write a "video info" chunk */
         roq_write_video_info_chunk(enc);
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/sgidec.c b/libavcodec/sgidec.c
index 4b98daf..e7f453b 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -205,10 +205,8 @@ static int decode_frame(AVCodecContext *avctx,
         return -1;
     avcodec_set_dimensions(avctx, s->width, s->height);
 
-    if (ff_get_buffer(avctx, p, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed.\n");
-        return -1;
-    }
+    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/sgirledec.c b/libavcodec/sgirledec.c
index 59f8e31..d49a957 100644
--- a/libavcodec/sgirledec.c
+++ b/libavcodec/sgirledec.c
@@ -115,11 +115,8 @@ static int sgirle_decode_frame(AVCodecContext *avctx,
     SGIRLEContext *s = avctx->priv_data;
     int ret;
 
-    ret = ff_reget_buffer(avctx, s->frame);
-    if (ret < 0) {
-        av_log (avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
-    }
 
     ret = decode_sgirle8(avctx, s->frame->data[0], avpkt->data, avpkt->size, avctx->width, avctx->height, s->frame->linesize[0]);
     if (ret < 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/smc.c b/libavcodec/smc.c
index 52dce53..bb00c69 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -434,10 +434,8 @@ static int smc_decode_frame(AVCodecContext *avctx,
 
     bytestream2_init(&s->gb, buf, buf_size);
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     if (pal) {
         s->frame.palette_has_changed = 1;
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 126acf3..8704cf4 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);
@@ -595,7 +594,7 @@ void ff_snow_release_buffer(AVCodecContext *avctx)
 
 int ff_snow_frame_start(SnowContext *s){
    AVFrame tmp;
-   int i;
+   int i, ret;
    int w= s->avctx->width; //FIXME round up to x16 ?
    int h= s->avctx->height;
 
@@ -636,10 +635,8 @@ int ff_snow_frame_start(SnowContext *s){
         }
     }
 
-    if(ff_get_buffer(s->avctx, &s->current_picture, AV_GET_BUFFER_FLAG_REF) < 0){
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
+    if ((ret = ff_get_buffer(s->avctx, &s->current_picture, AV_GET_BUFFER_FLAG_REF)) < 0)
+        return ret;
 
     s->current_picture.key_frame= s->keyframe;
 
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/tiertexseqv.c b/libavcodec/tiertexseqv.c
index 1c7e2e0..f892e4d 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -232,10 +232,8 @@ static int seqvideo_decode_frame(AVCodecContext *avctx,
 
     SeqVideoContext *seq = avctx->priv_data;
 
-    if ((ret = ff_reget_buffer(avctx, &seq->frame)) < 0) {
-        av_log(seq->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &seq->frame)) < 0)
         return ret;
-    }
 
     if (seqvideo_decode(seq, buf, buf_size))
         return AVERROR_INVALIDDATA;
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/truemotion1.c b/libavcodec/truemotion1.c
index a98897f..35fb2a3 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -868,10 +868,8 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
     if ((ret = truemotion1_decode_header(s)) < 0)
         return ret;
 
-    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0)
         return ret;
-    }
 
     if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
         truemotion1_decode_24bit(s);
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/utvideodec.c b/libavcodec/utvideodec.c
index 1bb2eb5..c098e44 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -333,10 +333,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     GetByteContext gb;
     ThreadFrame frame = { .f = data };
 
-    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
-    }
 
     /* parse plane structure to get frame flags and validate slice offsets */
     bytestream2_init(&gb, buf, buf_size);
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/vc1dec.c b/libavcodec/vc1dec.c
index aafc358..fd76c03 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5024,6 +5024,7 @@ static void vc1_draw_sprites(VC1Context *v, SpriteData* sd)
 
 static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
 {
+    int ret;
     MpegEncContext *s     = &v->s;
     AVCodecContext *avctx = s->avctx;
     SpriteData sd;
@@ -5041,10 +5042,8 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
     }
 
     av_frame_unref(&v->sprite_output_frame);
-    if (ff_get_buffer(avctx, &v->sprite_output_frame, 0) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
-    }
+    if ((ret = ff_get_buffer(avctx, &v->sprite_output_frame, 0)) < 0)
+        return ret;
 
     vc1_draw_sprites(v, &sd);
 
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..7f7143b 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -425,10 +425,8 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx,
     if (buf_size < 16)
         return buf_size;
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
-    }
 
     vmd_decode(s, frame);
 
@@ -597,10 +595,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/vp3.c b/libavcodec/vp3.c
index a77bf8f..9f7b5fa 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2024,10 +2024,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
 
     s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
     s->current_frame.f->key_frame = s->keyframe;
-    if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0)
         goto error;
-    }
 
     if (!s->edge_emu_buffer)
         s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.f->linesize[0]));
@@ -2055,10 +2053,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
             av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
 
             s->golden_frame.f->pict_type = AV_PICTURE_TYPE_I;
-            if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
-                av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+            if (ff_thread_get_buffer(avctx, &s->golden_frame, AV_GET_BUFFER_FLAG_REF) < 0)
                 goto error;
-            }
             ff_thread_release_buffer(avctx, &s->last_frame);
             if ((ret = ff_thread_ref_frame(&s->last_frame, &s->golden_frame)) < 0)
                 goto error;
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 00334d1..8ecaf11 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -524,10 +524,8 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         }
     }
 
-    if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0)
         return -1;
-    }
 
     if (s->has_alpha) {
         av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]);
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 9218dff..7bd1cc9 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1909,10 +1909,8 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
     curframe->tf.f->key_frame = s->keyframe;
     curframe->tf.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    if ((ret = vp8_alloc_frame(s, curframe, referenced))) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n");
+    if ((ret = vp8_alloc_frame(s, curframe, referenced)) < 0)
         goto err;
-    }
 
     // check if golden and altref are swapped
     if (s->update_altref != VP56_FRAME_NONE) {
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 6510582..a47e2db 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -598,10 +598,8 @@ static int vqa_decode_frame(AVCodecContext *avctx,
     AVFrame *frame = data;
     int res;
 
-    if ((res = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
         return res;
-    }
 
     bytestream2_init(&s->gb, avpkt->data, avpkt->size);
     if ((res = vqa_decode_chunk(s, frame)) < 0)
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/wmaprodec.c b/libavcodec/wmaprodec.c
index 08c1561..2a7507f 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1374,7 +1374,6 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
     /* get output buffer */
     frame->nb_samples = s->samples_per_frame;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         s->packet_loss = 1;
         return 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/wnv1.c b/libavcodec/wnv1.c
index dd72938..f7609af 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -82,7 +82,6 @@ static int decode_frame(AVCodecContext *avctx,
     }
 
     if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         av_free(rbuf);
         return ret;
     }
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/xan.c b/libavcodec/xan.c
index 3caa6c0..2ee2291 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -587,10 +587,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF))) {
-        av_log(s->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->frame_size)
         s->frame_size = frame->linesize[0] * s->avctx->height;
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/xxan.c b/libavcodec/xxan.c
index 8df097b..ed98ce1 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -392,10 +392,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
     int ftype;
     int ret;
 
-    if ((ret = ff_reget_buffer(avctx, &s->pic))) {
-        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+    if ((ret = ff_reget_buffer(avctx, &s->pic)) < 0)
         return ret;
-    }
 
     bytestream2_init(&s->gb, avpkt->data, avpkt->size);
     ftype = bytestream2_get_le32(&s->gb);
diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index 092e84c..e1f5321 100644
--- a/libavcodec/yop.c
+++ b/libavcodec/yop.c
@@ -188,11 +188,8 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return AVERROR_INVALIDDATA;
     }
 
-    ret = ff_get_buffer(avctx, frame, 0);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
-    }
 
     if (!avctx->frame_number)
         memset(frame->data[1], 0, AVPALETTE_SIZE);
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