From 93d672967d05f9769bbeb2ac6ceb8cbde302c273 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 4 Jul 2012 00:47:18 +0200 Subject: [PATCH] video_get_buffer: return ENOMEM instead of -1 on malloc failure Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 668965a237..b3af77d2d0 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -508,7 +508,8 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic) buf->linesize[i]= picture.linesize[i]; buf->base[i]= av_malloc(size[i]+16); //FIXME 16 - if(buf->base[i]==NULL) return -1; + if(buf->base[i]==NULL) + return AVERROR(ENOMEM); memset(buf->base[i], 128, size[i]); // no edge if EDGE EMU or not planar YUV