Commit 72bef015 authored by Rafaël Carré's avatar Rafaël Carré

flac packetizer: avoid realloc

parent 39e48a79
...@@ -145,8 +145,12 @@ static void ProcessHeader(decoder_t *p_dec) ...@@ -145,8 +145,12 @@ static void ProcessHeader(decoder_t *p_dec)
p_sys->b_stream_info = true; p_sys->b_stream_info = true;
p_dec->fmt_out.i_extra = i_extra; p_dec->fmt_out.i_extra = i_extra;
p_dec->fmt_out.p_extra = xrealloc(p_dec->fmt_out.p_extra, i_extra); free(p_dec->fmt_out.p_extra);
p_dec->fmt_out.p_extra = malloc(i_extra);
if (p_dec->fmt_out.p_extra)
memcpy(p_dec->fmt_out.p_extra, p_extra, i_extra); memcpy(p_dec->fmt_out.p_extra, p_extra, i_extra);
else
p_dec->fmt_out.i_extra = 0;
} }
/* Will return 0xffffffffffffffff for an invalid utf-8 sequence */ /* Will return 0xffffffffffffffff for an invalid utf-8 sequence */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment