mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-20 05:16:38 +00:00
avcodec/utils: Don't forget cleaning up when allocating priv_data fails
Allocating an AVCodecContext's priv_data used to be the first object
allocated in avcodec_open2(), so it was unnecessary to goto free_and_end
(which does the cleanup) upon error here. But this is no longer so since
f3a29b750a
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
c6e54d14c5
commit
d1dcc20126
@ -608,7 +608,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
|
||||
avctx->priv_data = av_mallocz(codec->priv_data_size);
|
||||
if (!avctx->priv_data) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
goto free_and_end;
|
||||
}
|
||||
if (codec->priv_class) {
|
||||
*(const AVClass **)avctx->priv_data = codec->priv_class;
|
||||
|
Loading…
Reference in New Issue
Block a user