[vlc-commits] [Git][videolan/vlc][master] input: decoder: fix use-after-free

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Aug 31 12:47:15 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
33db6000 by Alexandre Janniaux at 2022-08-31T12:26:35+00:00
input: decoder: fix use-after-free

Audio latency callback is using the fifo lock, which cannot be released
until the audio output is destroyed. In general, outputs can use the
fifo, and we need to release/detach them from the input decoder before
freeing the lock.

- - - - -


1 changed file:

- src/input/decoder.c


Changes:

=====================================
src/input/decoder.c
=====================================
@@ -2049,7 +2049,7 @@ static void DeleteDecoder( vlc_input_decoder_t *p_owner, enum es_format_category
         vlc_video_context_Release( p_owner->vctx );
 
     /* Free all packets still in the decoder fifo. */
-    block_FifoRelease( p_owner->p_fifo );
+    block_FifoEmpty( p_owner->p_fifo );
 
     /* Cleanup */
 #ifdef ENABLE_SOUT
@@ -2115,6 +2115,7 @@ static void DeleteDecoder( vlc_input_decoder_t *p_owner, enum es_format_category
     if( p_owner->p_description )
         vlc_meta_Delete( p_owner->p_description );
 
+    block_FifoRelease( p_owner->p_fifo );
     decoder_Destroy( p_owner->p_packetizer );
     decoder_Destroy( &p_owner->dec );
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/33db6000e3d10956244a3f4d44f81ffc577e2640

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


VideoLAN code repository instance


More information about the vlc-commits mailing list