Commit 51bdb2c2 authored by Thomas Guillem's avatar Thomas Guillem

mediacodec: p_block can change after a realloc

This was not happening because blocks are allocated with a pre-padding of 32
bits. But this behavior could change in function of the packetizer or demuxer.
parent df146d96
...@@ -1580,7 +1580,8 @@ static int Video_OnNewBlock(decoder_t *p_dec, block_t **pp_block, int *p_flags) ...@@ -1580,7 +1580,8 @@ static int Video_OnNewBlock(decoder_t *p_dec, block_t **pp_block, int *p_flags)
else if (p_dec->fmt_in.i_codec == VLC_CODEC_VC1) else if (p_dec->fmt_in.i_codec == VLC_CODEC_VC1)
{ {
/* Adding frame start code */ /* Adding frame start code */
if (!block_Realloc(p_block, 4, p_block->i_buffer)) p_block = *pp_block = block_Realloc(p_block, 4, p_block->i_buffer);
if (p_block == NULL)
return VLC_ENOMEM; return VLC_ENOMEM;
p_block->p_buffer[0] = 0x00; p_block->p_buffer[0] = 0x00;
p_block->p_buffer[1] = 0x00; p_block->p_buffer[1] = 0x00;
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