[FFmpeg-cvslog] r9769 - trunk/libavcodec/utils.c

takis subversion
Fri Jul 20 17:08:10 CEST 2007


Author: takis
Date: Fri Jul 20 17:08:10 2007
New Revision: 9769

Log:
Return AVERROR(ENOMEM) on memory allocation failure of avcodec_open.


Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Fri Jul 20 17:08:10 2007
@@ -832,8 +832,10 @@ int avcodec_open(AVCodecContext *avctx, 
 
     if (codec->priv_data_size > 0) {
         avctx->priv_data = av_mallocz(codec->priv_data_size);
-        if (!avctx->priv_data)
+        if (!avctx->priv_data) {
+            ret = AVERROR(ENOMEM);
             goto end;
+        }
     } else {
         avctx->priv_data = NULL;
     }




More information about the ffmpeg-cvslog mailing list