diff options
author | Logan Dethrow <log@lindenlab.com> | 2011-09-07 16:40:40 -0400 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2011-09-07 16:40:40 -0400 |
commit | b8fddce34d1737acf32d83dac423dbb7a948cc4a (patch) | |
tree | adf4c05ab3a42b2d3fed8fbda23c2de97840bab7 /indra/llimage/llimagej2c.cpp | |
parent | f73b795bb709b3060e06b4238ae4dac702f21301 (diff) | |
parent | 82b1b1bc6ee91e1778a16634fb9e2988da23fd71 (diff) |
Merge. Fixed issue with LLProxy code related to changes to the LLSocket interface.
Diffstat (limited to 'indra/llimage/llimagej2c.cpp')
-rw-r--r-- | indra/llimage/llimagej2c.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 44e6b89dd3..8c5dc63e9d 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -370,8 +370,7 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename) resetLastError(); S32 file_size = 0; - LLAPRFile infile ; - infile.open(filename, LL_APR_RB, NULL, &file_size); + LLAPRFile infile(filename, LL_APR_RB, &file_size); apr_file_t* apr_file = infile.getFileHandle() ; if (!apr_file) { @@ -385,14 +384,14 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename) } else { - U8 *data = new U8[file_size]; + U8 *data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), file_size); apr_size_t bytes_read = file_size; apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read infile.close() ; if (s != APR_SUCCESS || (S32)bytes_read != file_size) { - delete[] data; + FREE_MEM(LLImageBase::getPrivatePool(), data); setLastError("Unable to read entire file"); res = FALSE; } |