diff mbox series

[FFmpeg-devel,5/6] avcodec/options: Remove always-true check

Message ID 20210316203100.528950-5-andreas.rheinhardt@gmail.com
State Accepted
Commit 784c3c0d8552365431e19748aa32bf7bcacd1464
Headers show
Series [FFmpeg-devel,1/6] avcodec/utils: Check earlier for codec id/type mismatch | expand


Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 16, 2021, 8:30 p.m. UTC
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@gmail.com>
 libavcodec/options.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series


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);
-        }
             *(const AVClass**)s->priv_data = codec->priv_class;