mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
9510da2bca
commit
90f06ceaa0
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue