[vlmc-devel] AudioClipWorkflow: Fix heap buffer overflow

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 28 18:03:50 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 28 17:33:01 2016 +0200| [5a0f8e8131277d5fc2a55f36667ef9c5d2b560ed] | committer: Hugo Beauzée-Luyssen

AudioClipWorkflow: Fix heap buffer overflow

> https://code.videolan.org/videolan/vlmc/commit/5a0f8e8131277d5fc2a55f36667ef9c5d2b560ed
---

 src/Workflow/AudioClipWorkflow.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Workflow/AudioClipWorkflow.cpp b/src/Workflow/AudioClipWorkflow.cpp
index 6c0078c..fbcfdae 100644
--- a/src/Workflow/AudioClipWorkflow.cpp
+++ b/src/Workflow/AudioClipWorkflow.cpp
@@ -125,6 +125,11 @@ AudioClipWorkflow::lock( void *data, quint8 **pcm_buffer, size_t size )
     else
     {
         as = cw->m_availableBuffers.dequeue();
+        if ( as->size < size )
+        {
+            delete[] as->buff;
+            as->buff = nullptr;
+        }
         if ( as->buff == nullptr )
         {
             as->buff = new uchar[size];



More information about the Vlmc-devel mailing list