Revision f97905e6 libavfilter/vf_scale.c

View differences:

libavfilter/vf_scale.c
214 214

  
215 215
    scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL;
216 216

  
217
    if(scale->sws)
217
    if (scale->sws)
218 218
        sws_freeContext(scale->sws);
219 219
    scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
220 220
                                outlink->w, outlink->h, outlink->format,
221 221
                                scale->flags, NULL, NULL, NULL);
222
    if (scale->isws[0])
223
        sws_freeContext(scale->isws[0]);
222 224
    scale->isws[0] = sws_getContext(inlink ->w, inlink ->h/2, inlink ->format,
223 225
                                    outlink->w, outlink->h/2, outlink->format,
224 226
                                    scale->flags, NULL, NULL, NULL);
227
    if (scale->isws[1])
228
        sws_freeContext(scale->isws[1]);
225 229
    scale->isws[1] = sws_getContext(inlink ->w, inlink ->h/2, inlink ->format,
226 230
                                    outlink->w, outlink->h/2, outlink->format,
227 231
                                    scale->flags, NULL, NULL, NULL);

Also available in: Unified diff