diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 14fc4c0d08b918464b5761fadfee23ca73294375..acc1e85d8817271a3c57886596e131206170c9be 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -718,7 +718,7 @@ static int ReadKukiChunk( demux_t *p_demux, uint64_t i_size )
         int error = ProcessAACCookie( p_demux, p_peek, i_size );
         if( error ) return error;
     }
-    else
+    else if( p_sys->fmt.i_codec != 0 )
     {
         p_sys->fmt.i_extra = (int)i_size;
         p_sys->fmt.p_extra = malloc( i_size );