[FFmpeg-devel] [PATCH 5/6] avcodec/options: Remove always-true check
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Tue Mar 16 22:30:59 EET 2021
Added in dc51a72ba45fbefb9f1c6c3ca5a5b2388d69b2da, yet even back then
the check was always true as the AVCodecContext has already been memset
to zero before that.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavcodec/options.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 61689b48d9..53f13dab37 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -140,12 +140,10 @@ static int init_context_defaults(AVCodecContext *s, const AVCodec *codec)
s->reordered_opaque = AV_NOPTS_VALUE;
if(codec && codec->priv_data_size){
- if(!s->priv_data){
s->priv_data= av_mallocz(codec->priv_data_size);
if (!s->priv_data) {
return AVERROR(ENOMEM);
}
- }
if(codec->priv_class){
*(const AVClass**)s->priv_data = codec->priv_class;
av_opt_set_defaults(s->priv_data);
--
2.27.0
More information about the ffmpeg-devel
mailing list