vlc | branch: master | Tristan Matthews <[email protected]> | Wed Dec  4 
09:34:00 2013 -0500| [e79b939ba25922dc23014e39a72415016e455aa9] | committer: 
Tristan Matthews

opus: avoid NULL pointer dereference

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

 modules/codec/opus.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/codec/opus.c b/modules/codec/opus.c
index de6e3d0..32c0165 100644
--- a/modules/codec/opus.c
+++ b/modules/codec/opus.c
@@ -360,14 +360,15 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet 
*p_oggpacket,
 
     *pp_block = NULL; /* To avoid being fed the same packet again */
 
-    {
-        block_t *p_aout_buffer = DecodePacket( p_dec, p_oggpacket,
-                                               p_block->i_nb_samples,
-                                               (int)p_block->i_length );
+    if( !p_block )
+        return NULL;
 
-        block_Release( p_block );
-        return p_aout_buffer;
-    }
+    block_t *p_aout_buffer = DecodePacket( p_dec, p_oggpacket,
+                                           p_block->i_nb_samples,
+                                           (int)p_block->i_length );
+
+    block_Release( p_block );
+    return p_aout_buffer;
 }
 
 /*****************************************************************************

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to