Fix for memory leak caused by re-making mipmaps
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 9 May 2011 10:03:06 +0000 (10:03 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 9 May 2011 10:03:06 +0000 (10:03 +0000)
Problem was caused by different limits for "last" mipmap: it was 1x1
for mkaing mipmaps and 2x2 for re-making.

2x2 should be enough for mipmap.

source/blender/imbuf/intern/filter.c

index 2821ba2a361b52c8db99d1e863ecdd7aaaf5ffb1..16fb1fdf4aa982cd39702ae636c0111c57250150 100644 (file)
@@ -437,7 +437,7 @@ void IMB_makemipmap(ImBuf *ibuf, int use_filter)
                hbuf= ibuf->mipmap[curmap];
                hbuf->miplevel= curmap+1;
 
-               if(!hbuf || (hbuf->x == 1 && hbuf->y == 1))
+               if(!hbuf || (hbuf->x <= 2 && hbuf->y <= 2))
                        break;
 
                curmap++;