Commit 4c9e6a7b authored by mstorsjo's avatar mstorsjo

Properly pad H.264 extradata when taken from fmtp SDP attributes

This fixes some valgrind warnings.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22182 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3e4e86bf
......@@ -134,7 +134,9 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream,
packet_size= av_base64_decode(decoded_packet, base64packet, sizeof(decoded_packet));
if (packet_size) {
uint8_t *dest= av_malloc(packet_size+sizeof(start_sequence)+codec->extradata_size);
uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) +
codec->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE);
if(dest)
{
if(codec->extradata_size)
......@@ -146,6 +148,8 @@ static void sdp_parse_fmtp_config_h264(AVStream * stream,
memcpy(dest+codec->extradata_size, start_sequence, sizeof(start_sequence));
memcpy(dest+codec->extradata_size+sizeof(start_sequence), decoded_packet, packet_size);
memset(dest+codec->extradata_size+sizeof(start_sequence)+
packet_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
codec->extradata= dest;
codec->extradata_size+= sizeof(start_sequence)+packet_size;
......
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