]> git.sesse.net Git - vlc/commitdiff
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 25f19573f57cbe985c7718dc6b568865d4ec777d..e8e82981820908581e22d21efb105fdc6ba82366 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;
         }