qtrle: return a meaningful error code.
authorAnton Khirnov <anton@khirnov.net>
Mon, 19 Nov 2012 09:33:54 +0000 (10:33 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 14 Jan 2013 10:37:31 +0000 (11:37 +0100)
libavcodec/qtrle.c

index 02091d0..32ad5d6 100644 (file)
@@ -389,14 +389,15 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
     int header, start_line;
     int height, row_ptr;
     int has_palette = 0;
     int header, start_line;
     int height, row_ptr;
     int has_palette = 0;
+    int ret;
 
     bytestream2_init(&s->g, avpkt->data, avpkt->size);
     s->frame.reference = 1;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                             FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
 
     bytestream2_init(&s->g, avpkt->data, avpkt->size);
     s->frame.reference = 1;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                             FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
-    if (avctx->reget_buffer(avctx, &s->frame)) {
+    if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) {
         av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
         av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
-        return -1;
+        return ret;
     }
 
     /* check if this frame is even supposed to change */
     }
 
     /* check if this frame is even supposed to change */