[FFmpeg-cvslog] avcodec/utils: Don't forget cleaning up when allocating priv_data fails
Andreas Rheinhardt
git at videolan.org
Thu Oct 1 15:13:47 EEST 2020
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Sep 24 23:54:17 2020 +0200| [d1dcc20126f3df52762bf5972a282d1699ef1ca8] | committer: Andreas Rheinhardt
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
f3a29b750a5979ae6847879fba758faf1fae88d0.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1dcc20126f3df52762bf5972a282d1699ef1ca8
---
libavcodec/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a8af45d0c3..05064b560f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list