]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v210dec.c
Merge commit '8729698d50739524665090e083d1bfdf28235724'
[ffmpeg] / libavcodec / v210dec.c
index 63037adb8dcf49858a6d47e3c48bd422a1d8cd67..132b42ad979a8d01db88279f184b75363a707262 100644 (file)
@@ -55,7 +55,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     if (avctx->width & 1) {
         av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
     avctx->pix_fmt             = AV_PIX_FMT_YUV422P10;
     avctx->bits_per_raw_sample = 10;
@@ -77,7 +77,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 {
     V210DecContext *s = avctx->priv_data;
 
-    int h, w, stride, aligned_input;
+    int h, w, ret, stride, aligned_input;
     AVFrame *pic = avctx->coded_frame;
     const uint8_t *psrc = avpkt->data;
     uint16_t *y, *u, *v;
@@ -97,7 +97,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             s->stride_warning_shown = 1;
         } else {
             av_log(avctx, AV_LOG_ERROR, "packet too small\n");
-            return -1;
+            return AVERROR_INVALIDDATA;
         }
     }
 
@@ -112,8 +112,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         avctx->release_buffer(avctx, pic);
 
     pic->reference = 0;
-    if (ff_get_buffer(avctx, pic) < 0)
-        return -1;
+    if ((ret = ff_get_buffer(avctx, pic)) < 0)
+        return ret;
 
     y = (uint16_t*)pic->data[0];
     u = (uint16_t*)pic->data[1];