[vlc-commits] [Git][videolan/vlc][master] faad: check config validity

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sun Aug 8 14:27:58 UTC 2021



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
8beee731 by Lyndon Brown at 2021-08-08T13:20:18+00:00
faad: check config validity

the `NeAACDecSetConfiguration()` function copies attributes from the given
config object to the actual config held within the decoder context object..
it validates each config attribute before copying it, immediately returning
zero if the attribute is invalid.

we should use the return value to check that our config was successfully
written.

- - - - -


1 changed file:

- modules/codec/faad.c


Changes:

=====================================
modules/codec/faad.c
=====================================
@@ -173,7 +173,13 @@ static int Open( vlc_object_t *p_this )
     if( p_dec->fmt_in.audio.i_rate )
         cfg->defSampleRate = p_dec->fmt_in.audio.i_rate;
     cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT;
-    NeAACDecSetConfiguration( p_sys->hfaad, cfg );
+    if( !NeAACDecSetConfiguration( p_sys->hfaad, cfg ) )
+    {
+        msg_Err( p_dec, "Failed to set faad configuration" );
+        NeAACDecClose( p_sys->hfaad );
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
 
     p_sys->i_last_length = 0;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8beee731064750745667cf21b63394c04157dd35

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8beee731064750745667cf21b63394c04157dd35
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list