and fix a null-dereference
Test url: rtmp://cp31335.live.edgefcs.net/live/ (no longer crash but doesn't work)
i++; /* Pass over AMF_DATATYPE_STRING */
string = amf_decode_string( &i );
+ if( !string )
+ {
+ msg_Err(p_thread,"Seriously broken stream");
+ return;
+ }
i++; /* Pass over AMF_DATATYPE_NUMBER */
number = amf_decode_number( &i );
length = ntoh16( *(uint16_t *) *buffer );
*buffer += sizeof( uint16_t );
+ if( length > sizeof( *buffer ) / sizeof( uint8_t ))
+ return NULL;
+
out = (char *) malloc( length + 1 ); /* '\0' terminated */
if( !out ) return NULL;