1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

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