diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llmedia/llmediaimplquicktime.cpp | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmedia/llmediaimplquicktime.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/linden/indra/llmedia/llmediaimplquicktime.cpp b/linden/indra/llmedia/llmediaimplquicktime.cpp index b126e2f..8f7686d 100644 --- a/linden/indra/llmedia/llmediaimplquicktime.cpp +++ b/linden/indra/llmedia/llmediaimplquicktime.cpp | |||
@@ -116,11 +116,19 @@ bool LLMediaImplQuickTime::load( const std::string url ) | |||
116 | if ( url.empty() ) | 116 | if ( url.empty() ) |
117 | return false; | 117 | return false; |
118 | 118 | ||
119 | //In case std::string::c_str() makes a copy of the url data, | ||
120 | //make sure there is memory to hold it before allocating memory for handle. | ||
121 | //if fails, NewHandleClear(...) should return NULL. | ||
122 | const char* url_string = url.c_str() ; | ||
119 | Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); | 123 | Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); |
120 | if ( NULL == handle ) | 124 | if ( NULL == handle ) |
121 | return false; | 125 | return false; |
126 | if(noErr != MemError() || NULL == *handle) | ||
127 | { | ||
128 | return false ; | ||
129 | } | ||
122 | 130 | ||
123 | BlockMove( url.c_str(), *handle, ( Size )( url.length() + 1 ) ); | 131 | BlockMove( url_string, *handle, ( Size )( url.length() + 1 ) ); |
124 | 132 | ||
125 | //std::cout << "LLMediaImplQuickTime::load( " << url << " )" << std::endl; | 133 | //std::cout << "LLMediaImplQuickTime::load( " << url << " )" << std::endl; |
126 | 134 | ||