[vlc-commits] demux: adaptive: fix potential use after free on oom

Francois Cartegnie git at videolan.org
Mon May 20 12:40:30 CEST 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 16 16:14:49 2019 +0200| [643cedc4bc06603e839d7ee38c41cab4ef9c35f6] | committer: Francois Cartegnie

demux: adaptive: fix potential use after free on oom

(cherry picked from commit 5d7bc4dbcb27cc74beb43c8eb0a2cf6369cdc4d7)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=643cedc4bc06603e839d7ee38c41cab4ef9c35f6
---

 modules/demux/adaptive/plumbing/FakeESOut.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index bc1517ebc7..52a71e8ef7 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -102,8 +102,6 @@ FakeESOutID * FakeESOut::createNewID( const es_format_t *p_fmt )
         extrainfo->fillExtraFMTInfo( &fmtcopy );
 
     FakeESOutID *es_id = new (std::nothrow) FakeESOutID( this, &fmtcopy );
-    if(likely(es_id))
-        fakeesidlist.push_back( es_id );
 
     vlc_mutex_unlock(&lock);
 
@@ -289,6 +287,7 @@ es_out_id_t * FakeESOut::esOutAdd_Callback(es_out_t *fakees, const es_format_t *
         AbstractCommand *command = me->commandsqueue->factory()->createEsOutAddCommand( es_id );
         if( likely(command) )
         {
+            me->fakeesidlist.push_back(es_id);
             me->commandsqueue->Schedule( command );
             return reinterpret_cast<es_out_id_t *>(es_id);
         }



More information about the vlc-commits mailing list