diff options
author | Martin Storsjö <martin@martin.st> | 2010-03-03 21:00:50 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-03-03 21:00:50 +0000 |
commit | b9b8ed2a0294e00a5415232912c08cf92d5387f4 (patch) | |
tree | 0af357f96ea804a31ce125bc6bee609fa3ffa675 /libavformat/rtpdec_h264.c | |
parent | bd8868e0929662e7bea5c7efff69daece1df9126 (diff) | |
download | ffmpeg-b9b8ed2a0294e00a5415232912c08cf92d5387f4.tar.gz |
Properly pad H.264 extradata when taken from fmtp SDP attributes
This fixes some valgrind warnings.
Originally committed as revision 22182 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_h264.c')
-rw-r--r-- | libavformat/rtpdec_h264.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index f41dfdcc39..970e6fdcc7 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -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; |