packetizer: flac: fix realloc call
authorTristan Matthews <tmatth@videolan.org>
Fri, 21 Nov 2014 18:43:33 +0000 (13:43 -0500)
committerTristan Matthews <tmatth@videolan.org>
Fri, 21 Nov 2014 18:44:45 +0000 (13:44 -0500)
modules/packetizer/flac.c

index 25f1957..e8e8298 100644 (file)
@@ -607,9 +607,10 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block)
          * We'll update it as we look for the next start code. */
         if (p_sys->i_buf < p_sys->i_frame_size)
         {
-            p_sys->p_buf = realloc(p_sys->p_buf, p_sys->i_frame_size);
-            if (!p_sys->p_buf)
+            uint8_t *p_buf = realloc(p_sys->p_buf, p_sys->i_frame_size);
+            if (!p_buf)
                 return NULL;
+            p_sys->p_buf = p_buf;
             p_sys->i_buf = p_sys->i_frame_size;
         }