summaryrefslogtreecommitdiff
path: root/indra/media_plugins/quicktime
diff options
context:
space:
mode:
authorcallum <none@none>2009-11-16 18:42:35 -0800
committercallum <none@none>2009-11-16 18:42:35 -0800
commit18eab4a02675195c6498ca7b0982e62f0ddf9e60 (patch)
tree1c901e398dfef674d95d2abb5b22fe6a48f7b51f /indra/media_plugins/quicktime
parent16fa3a40e30e453a0feadf7fe053ba6442057dc9 (diff)
Merge with tip
Diffstat (limited to 'indra/media_plugins/quicktime')
-rw-r--r--indra/media_plugins/quicktime/media_plugin_quicktime.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index dac0509531..182fab69d0 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -552,7 +552,7 @@ private:
processState();
// see if title arrived and if so, update member variable with contents
- checkTitle();
+ //checkTitle();
// QT call to see if we are at the end - can't do with controller
if ( IsMovieDone( mMovieHandle ) )
@@ -718,18 +718,24 @@ private:
// find the size of the title
ByteCount size;
result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
- if ( noErr != result || size <= 0 )
+ if ( noErr != result || size <= 0 /*|| size > 1024 /* FIXME: arbitrary limit */ )
return false;
// allocate some space and grab it
- UInt8* item_data = new UInt8( size );
- memset( item_data, 0, size * sizeof( UInt8* ) );
+ UInt8* item_data = new UInt8( size + 1 );
+ memset( item_data, 0, ( size + 1 ) * sizeof( UInt8* ) );
result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
if ( noErr != result )
+ {
+ delete [] item_data;
return false;
+ };
// save it
- mMovieTitle = std::string( (char* )item_data );
+ if ( strlen( (char*)item_data ) )
+ mMovieTitle = std::string( (char* )item_data );
+ else
+ mMovieTitle = "";
// clean up
delete [] item_data;