Author: orw
Date: Mon Mar 12 16:15:25 2012
New Revision: 1299729

URL: http://svn.apache.org/viewvc?rev=1299729&view=rev
Log:
some clean up in JPEGReader due to memory constraints
- found during testing of insertion of linked images from HTTP/HTTPS servers

Modified:
    incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx

Modified: incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx?rev=1299729&r1=1299728&r2=1299729&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx Mon Mar 12 
16:15:25 2012
@@ -397,6 +397,14 @@ void* JPEGReader::CreateBitmap( void* pP
                        ((JPEGCreateBitmapParam*)pParam)->bTopDown = sal_True;
                        pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * 
aSize.Height() );
                }
+
+        // clean up, if no Bitmap buffer can be provided.
+        if ( pBmpBuf == 0 )
+        {
+            aBmp.ReleaseAccess( pAcc );
+            pAcc = NULL;
+        }
+
         ((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth;
        }
 


Reply via email to