From 90f06ceaa0dcc9a40029d6e7438fb2291e4d351c Mon Sep 17 00:00:00 2001 From: Panagiotis Issaris Date: Fri, 20 Jul 2007 15:08:10 +0000 Subject: [PATCH] Return AVERROR(ENOMEM) on memory allocation failure of avcodec_open. Originally committed as revision 9769 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f5f9f2f0d1..cd7bc1c09a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -832,8 +832,10 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec) 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; }