[FFmpeg-cvslog] avcodec/options: Remove always-true check

Andreas Rheinhardt git at videolan.org
Sat Mar 20 04:49:49 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Tue Mar 16 20:41:42 2021 +0100| [784c3c0d8552365431e19748aa32bf7bcacd1464] | committer: Andreas Rheinhardt

avcodec/options: Remove always-true check

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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=784c3c0d8552365431e19748aa32bf7bcacd1464
---

 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);



More information about the ffmpeg-cvslog mailing list