Changeset 2684


Ignore:
Timestamp:
Aug 10, 2008, 5:16:47 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • convolution.c: fix a small memory leak in the convolution filter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/filter/convolution.c

    r2661 r2684  
    3636pipi_image_t *pipi_convolution(pipi_image_t *src, int m, int n, double mat[])
    3737{
     38    pipi_image_t *ret;
    3839    double tmp;
    3940    double *hvec, *vvec;
     
    7677
    7778    /* Matrix rank is 1! Separate the filter */
    78     /* FIXME: memleak */
    7979    hvec = malloc(m * sizeof(double));
    8080    vvec = malloc(n * sizeof(double));
     
    8686        vvec[j] = mat[j * m + besti] / tmp;
    8787
    88     return pipi_convolution_separable(src, m, hvec, n, vvec);
     88    ret = pipi_convolution_separable(src, m, hvec, n, vvec);
     89
     90    free(hvec);
     91    free(vvec);
     92
     93    return ret;
    8994}
    9095
Note: See TracChangeset for help on using the changeset viewer.