diff options
Diffstat (limited to 'src/display/pixblock-scaler.cpp')
| -rw-r--r-- | src/display/pixblock-scaler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/display/pixblock-scaler.cpp b/src/display/pixblock-scaler.cpp index 5bf3c2762..39c82daf6 100644 --- a/src/display/pixblock-scaler.cpp +++ b/src/display/pixblock-scaler.cpp @@ -96,11 +96,13 @@ static void scale_bicubic_rgba(NRPixBlock *to, NRPixBlock *from) return; } + bool free_from_on_exit = false; if (from->mode != to->mode){ NRPixBlock *o_from = from; from = new NRPixBlock; nr_pixblock_setup_fast(from, to->mode, o_from->area.x0, o_from->area.y0, o_from->area.x1, o_from->area.y1, false); nr_blit_pixblock_pixblock(from, o_from); + free_from_on_exit = true; } // Precalculate sizes of source and destination pixblocks @@ -198,6 +200,11 @@ static void scale_bicubic_rgba(NRPixBlock *to, NRPixBlock *from) } } } + if (free_from_on_exit) { + nr_pixblock_release(from); + delete from; + } + } void scale_bicubic_alpha(NRPixBlock *to, NRPixBlock *from) |
