video_get_buffer: return ENOMEM instead of -1 on malloc failure
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jul 2012 22:47:18 +0000 (00:47 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jul 2012 22:47:18 +0000 (00:47 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 668965a..b3af77d 100644 (file)
@@ -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