Ticket #4937: filters_adjust_filter_adjust.c-init-vars-in-newAdjustFilter.patch

File filters_adjust_filter_adjust.c-init-vars-in-newAdjustFilter.patch, 1.1 KB (added by Erik Hovland <erik@…>, 16 years ago)

inits vars in newAdjustFilter

  • filters/adjust/filter_adjust.c

    A pile of inits are not initialized. But most importantly, ymin is not initialized
    
    From: Erik Hovland <erik@hovland.org>
    
    and could potentially be tested without having been filled if the sscanf
    is given a bogus string.
    ---
    
     filters/adjust/filter_adjust.c |    3 +--
     1 files changed, 1 insertions(+), 2 deletions(-)
    
    diff --git a/filters/adjust/filter_adjust.c b/filters/adjust/filter_adjust.c
    index 8cbbdef..52215ce 100644
    a b newAdjustFilter (VideoFrameType inpixfmt, VideoFrameType outpixfmt, 
    238238                 int *width, int *height, char *options)
    239239{
    240240    ThisFilter *filter;
    241     int numopts, ymin, ymax, cmin, cmax;
     241    int numopts = 0, ymin = -1, ymax = -1, cmin = -1, cmax = -1;
    242242    float ygamma, cgamma;
    243243    (void) width;
    244244    (void) height;
    newAdjustFilter (VideoFrameType inpixfmt, VideoFrameType outpixfmt, 
    251251        return NULL;
    252252    }
    253253
    254     numopts = 0;
    255254    if (options)
    256255        numopts = sscanf(options, "%d:%d:%f:%d:%d:%f", &ymin, &ymax, &ygamma,
    257256                         &cmin, &cmax, &cgamma);