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

Originally committed as revision 9769 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Panagiotis Issaris 2007-07-20 15:08:10 +00:00
parent 9510da2bca
commit 90f06ceaa0
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}