changeset 6251:0db22f6ec19e libavformat

Handle av_base64_decode return value garbled sdp would cause crash otherwise.
author lu_zero
date Sun, 11 Jul 2010 11:54:48 +0000
parents f7b036d62ba9
children deebd9ec774e
files rtpdec_h264.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rtpdec_h264.c	Sun Jul 11 11:28:46 2010 +0000
+++ b/rtpdec_h264.c	Sun Jul 11 11:54:48 2010 +0000
@@ -120,7 +120,7 @@
         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 @@
                 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);