fix for opus memory allocation error by Fred, of radio panik

This commit is contained in:
rafael@riseup.net 2013-05-28 14:36:12 +00:00
parent c57d870c73
commit 3f511ecda0
2 changed files with 2 additions and 2 deletions

View File

@ -240,7 +240,7 @@ OpusLibEncoder :: open ( void )
strncpy(name, "Darkice Stream", 39);
}
tags[0].tag_len = strlen(titlestr) + strlen(name);
tags[0].tag_str = (char*) malloc( tags[0].tag_len );
tags[0].tag_str = (char*) malloc( tags[0].tag_len + 1 );
if( tags[0].tag_str == NULL ) {
throw Exception( __FILE__, __LINE__, "malloc failed");
}

View File

@ -93,7 +93,7 @@ struct OpusIdHeader {
inline int buildPacket( unsigned char** packet) throw ( Exception ) {
int i = 0;
// FIXME - doesn't support multistream
unsigned char* out = (unsigned char*)malloc(15);
unsigned char* out = (unsigned char*)malloc(19);
if( out == NULL ) {
throw Exception( __FILE__, __LINE__, "cannot alloc buffer");
}