[FFmpeg-cvslog] wnv1: return meaningful error codes.

Anton Khirnov git at videolan.org
Mon Jan 7 00:44:47 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Nov 16 18:35:31 2012 +0100| [f3fcb1a7b26a88a707e8853c65f3adeb0a291564] | committer: Anton Khirnov

wnv1: return meaningful error codes.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3fcb1a7b26a88a707e8853c65f3adeb0a291564
---

 libavcodec/wnv1.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 1636f16..0e727db 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -67,24 +67,24 @@ static int decode_frame(AVCodecContext *avctx,
     int buf_size          = avpkt->size;
     AVFrame * const p     = &l->pic;
     unsigned char *Y,*U,*V;
-    int i, j;
+    int i, j, ret;
     int prev_y = 0, prev_u = 0, prev_v = 0;
     uint8_t *rbuf;
 
     rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!rbuf) {
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
-        return -1;
+        return AVERROR(ENOMEM);
     }
 
     if (p->data[0])
         avctx->release_buffer(avctx, p);
 
     p->reference = 0;
-    if(ff_get_buffer(avctx, p) < 0){
+    if ((ret = ff_get_buffer(avctx, p)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         av_free(rbuf);
-        return -1;
+        return ret;
     }
     p->key_frame = 1;
 



More information about the ffmpeg-cvslog mailing list