Commit 458f4c2e authored by philipjsg's avatar philipjsg

* Don't allocate 0 bytes of memory. It upsets electricFence!


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@472 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 38d5fd8f
......@@ -71,12 +71,17 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
avctx->codec = codec;
avctx->frame_number = 0;
avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data)
return -ENOMEM;
if (codec->priv_data_size > 0) {
avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data)
return -ENOMEM;
} else {
avctx->priv_data = NULL;
}
ret = avctx->codec->init(avctx);
if (ret < 0) {
free(avctx->priv_data);
if (avctx->priv_data)
free(avctx->priv_data);
avctx->priv_data = NULL;
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment