[libav-commits] rpza: return a meaningful error code.

Anton Khirnov git at libav.org
Mon Jan 14 11:47:00 CET 2013


Module: libav
Branch: master
Commit: e4ca055b3ce31a2faacd4c25e009cae69754cdac

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Mon Nov 19 10:52:33 2012 +0100

rpza: return a meaningful error code.

---

 libavcodec/rpza.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 57d4d2d..ee36607 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -250,15 +250,16 @@ static int rpza_decode_frame(AVCodecContext *avctx,
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
     RpzaContext *s = avctx->priv_data;
+    int ret;
 
     s->buf = buf;
     s->size = buf_size;
 
     s->frame.reference = 1;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
-    if (avctx->reget_buffer(avctx, &s->frame)) {
+    if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return -1;
+        return ret;
     }
 
     rpza_decode_stream(s);



More information about the libav-commits mailing list