Revision: 28725
          http://sourceforge.net/p/bibdesk/svn/28725
Author:   hofman
Date:     2024-02-11 16:57:45 +0000 (Sun, 11 Feb 2024)
Log Message:
-----------
make sure image buffer is not releasedby ARC before its buffer is used to 
create image

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-02-10 17:37:04 UTC (rev 28724)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-02-11 16:57:45 UTC (rev 28725)
@@ -800,7 +800,7 @@
      */
     vImage_Error ret = kvImageNoError;
     
-    FVImageBuffer *interleavedImageBuffer = [[FVImageBuffer alloc] 
initWithWidth:desiredSize.width height:desiredSize.height bytesPerSample:4];
+    NS_VALID_UNTIL_END_OF_SCOPE FVImageBuffer *interleavedImageBuffer = 
[[FVImageBuffer alloc] initWithWidth:desiredSize.width 
height:desiredSize.height bytesPerSample:4];
     if (nil == interleavedImageBuffer) 
         ret = kvImageMemoryAllocationError;
         
@@ -838,9 +838,10 @@
     }
         
     FVImageBuffer *imageBuffer;
+    size_t r = FVPaddedRowBytesForWidth(1, maxWidth);
     NSUInteger i;
     for (i = 0; i < 8 && kvImageNoError == ret; i++) {
-        imageBuffer = [[FVImageBuffer alloc] initWithWidth:maxWidth 
height:maxHeight bytesPerSample:1];
+        imageBuffer = [[FVImageBuffer alloc] initWithWidth:maxWidth 
height:maxHeight rowBytes:r];
         if (imageBuffer) {
             [planarTiles addObject:imageBuffer];
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to