summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_h264.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2010-07-11 11:54:48 +0000
committerLuca Barbato <lu_zero@gentoo.org>2010-07-11 11:54:48 +0000
commitdc6cf61e331557eb275a44d7a31df8e781bbb22b (patch)
tree51ba08cf441c71d7eec06073becb7a8428d7c2cb /libavformat/rtpdec_h264.c
parent617d56cafaf5e2a1b83301667c3075e5f362cde0 (diff)
Handle av_base64_decode return value
garbled sdp would cause crash otherwise. Originally committed as revision 24191 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_h264.c')
-rw-r--r--libavformat/rtpdec_h264.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 06e30ab953..3ee0788f9b 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -120,7 +120,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
while (*value) {
char base64packet[1024];
uint8_t decoded_packet[1024];
- uint32_t packet_size;
+ int packet_size;
char *dst = base64packet;
while (*value && *value != ','
@@ -133,7 +133,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
value++;
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) +
codec->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE);