Commit dc6cf61e authored by Luca Barbato's avatar Luca Barbato

Handle av_base64_decode return value

garbled sdp would cause crash otherwise.

Originally committed as revision 24191 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 617d56ca
...@@ -120,7 +120,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, ...@@ -120,7 +120,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
while (*value) { while (*value) {
char base64packet[1024]; char base64packet[1024];
uint8_t decoded_packet[1024]; uint8_t decoded_packet[1024];
uint32_t packet_size; int packet_size;
char *dst = base64packet; char *dst = base64packet;
while (*value && *value != ',' while (*value && *value != ','
...@@ -133,7 +133,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, ...@@ -133,7 +133,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
value++; value++;
packet_size= av_base64_decode(decoded_packet, base64packet, sizeof(decoded_packet)); packet_size= av_base64_decode(decoded_packet, base64packet, sizeof(decoded_packet));
if (packet_size) { if (packet_size > 0) {
uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) + uint8_t *dest = av_malloc(packet_size + sizeof(start_sequence) +
codec->extradata_size + codec->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE); FF_INPUT_BUFFER_PADDING_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