[FFmpeg-cvslog] video_get_buffer: return ENOMEM instead of -1 on malloc failure

Michael Niedermayer git at videolan.org
Wed Jul 4 01:12:24 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul  4 00:47:18 2012 +0200| [93d672967d05f9769bbeb2ac6ceb8cbde302c273] | committer: Michael Niedermayer

video_get_buffer: return ENOMEM instead of -1 on malloc failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93d672967d05f9769bbeb2ac6ceb8cbde302c273
---

 libavcodec/utils.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 668965a..b3af77d 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



More information about the ffmpeg-cvslog mailing list