OSDN Git Service

v210enc: return proper AVERROR codes instead of -1
authorPaul B Mahol <onemda@gmail.com>
Sun, 5 Feb 2012 21:14:36 +0000 (21:14 +0000)
committerAnton Khirnov <anton@khirnov.net>
Mon, 6 Feb 2012 06:59:47 +0000 (07:59 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/v210enc.c

index 6266bb9..c31254e 100644 (file)
@@ -28,7 +28,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
 {
     if (avctx->width & 1) {
         av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
 
     if (avctx->pix_fmt != PIX_FMT_YUV422P10) {
@@ -64,7 +64,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
 
     if (buf_size < aligned_width * avctx->height * 8 / 3) {
         av_log(avctx, AV_LOG_ERROR, "output buffer too small\n");
-        return -1;
+        return AVERROR(ENOMEM);
     }
 
 #define CLIP(v) av_clip(v, 4, 1019)