[vlc-devel] [RFC PATCH 09/13] omxil: fix possible memory corruption

Thomas Guillem guillem at archos.com
Thu Jun 26 14:05:57 CEST 2014


For output buffers, pInputPortPrivate is already used by the OMX_FIFO.

It was safe for the current state. Indeed, the output fifo had never more than
one elements, so pInputPortPrivate was always NULL, and then pBuffer was never
overwritten in OmxFillBufferDone.
---
 modules/codec/omxil/omxil.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index ea3d7e2..75196b3 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1281,7 +1281,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
             OMX_FIFO_GET(&p_sys->out.fifo, p_header);
             p_header->pAppPrivate = p_next_pic;
-            p_header->pInputPortPrivate = p_header->pBuffer;
+            p_header->pOutputPortPrivate = p_header->pBuffer;
             p_header->pBuffer = p_next_pic->p[0].p_pixels;
         }
         else
@@ -1744,9 +1744,9 @@ static OMX_ERRORTYPE OmxFillBufferDone( OMX_HANDLETYPE omx_handle,
              (int)omx_header->nFilledLen, FromOmxTicks(omx_header->nTimeStamp) );
 #endif
 
-    if(omx_header->pInputPortPrivate)
+    if(omx_header->pOutputPortPrivate)
     {
-        omx_header->pBuffer = omx_header->pInputPortPrivate;
+        omx_header->pBuffer = omx_header->pOutputPortPrivate;
     }
     OMX_FIFO_PUT(&p_sys->out.fifo, omx_header);
 
-- 
1.7.10.4


-- 


This email and any files transmitted with it are confidential and are 
intended solely for the use of the individual or entity to which they are 
addressed. Access to this e-mail by anyone else is unauthorised. If you are 
not the intended recipient, any disclosure, copying, distribution or any 
action taken or omitted to be taken in reliance on it, is prohibited. 
E-mail messages are not necessarily secure. Archos does not accept 
responsibility for any changes made to this message after it was sent.



More information about the vlc-devel mailing list