]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/roqvideodec.c
lavc/roqvideodec: propagate reget_buffer() error code
[ffmpeg] / libavcodec / roqvideodec.c
index 9adfd5dc4333669c124748908f02d1af8de4a749..cd4eb2aae79012cac64fde259f0f066591f31ee9 100644 (file)
  *   http://www.csse.monash.edu.au/~timf/
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #include "avcodec.h"
 #include "bytestream.h"
 #include "roqvideo.h"
@@ -192,11 +188,12 @@ static int roq_decode_frame(AVCodecContext *avctx,
     int buf_size = avpkt->size;
     RoqContext *s = avctx->priv_data;
     int copy= !s->current_frame->data[0];
+    int ret;
 
     s->current_frame->reference = 3;
-    if (avctx->reget_buffer(avctx, s->current_frame)) {
+    if ((ret = avctx->reget_buffer(avctx, s->current_frame)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "  RoQ: get_buffer() failed\n");
-        return -1;
+        return ret;
     }
 
     if(copy)
@@ -231,7 +228,7 @@ static av_cold int roq_decode_end(AVCodecContext *avctx)
 AVCodec ff_roq_decoder = {
     .name           = "roqvideo",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_ROQ,
+    .id             = AV_CODEC_ID_ROQ,
     .priv_data_size = sizeof(RoqContext),
     .init           = roq_decode_init,
     .close          = roq_decode_end,