[FFmpeg-cvslog] r22182 - trunk/libavformat/rtpdec_h264.c

mstorsjo subversion
Wed Mar 3 22:00:51 CET 2010


Author: mstorsjo
Date: Wed Mar  3 22:00:50 2010
New Revision: 22182

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

This fixes some valgrind warnings.

Modified:
   trunk/libavformat/rtpdec_h264.c

Modified: trunk/libavformat/rtpdec_h264.c
==============================================================================
--- trunk/libavformat/rtpdec_h264.c	Wed Mar  3 21:36:56 2010	(r22181)
+++ trunk/libavformat/rtpdec_h264.c	Wed Mar  3 22:00:50 2010	(r22182)
@@ -134,7 +134,9 @@ static void sdp_parse_fmtp_config_h264(A
 
             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(A
 
                     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;



More information about the ffmpeg-cvslog mailing list