Check param in sws_getCachedContext().

Patch by KO Myung-Hun komh chollian net
Original thread: [FFmpeg-devel] [PATCH] param check in sws_getCachedContext()
Date: Wed Jan 9 11:15:19 CET 2008

Originally committed as revision 25775 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
pull/126/head
KO Myung-Hun 17 years ago committed by Benoit Fouet
parent 76d7c327eb
commit 337a2a4530
  1. 7
      libswscale/swscale.c

@ -2959,12 +2959,17 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
int dstW, int dstH, int dstFormat, int flags, int dstW, int dstH, int dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
{ {
static const double default_param[2] = {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT};
if (!param)
param = default_param;
if (context != NULL) { if (context != NULL) {
if ((context->srcW != srcW) || (context->srcH != srcH) || if ((context->srcW != srcW) || (context->srcH != srcH) ||
(context->srcFormat != srcFormat) || (context->srcFormat != srcFormat) ||
(context->dstW != dstW) || (context->dstH != dstH) || (context->dstW != dstW) || (context->dstH != dstH) ||
(context->dstFormat != dstFormat) || (context->flags != flags) || (context->dstFormat != dstFormat) || (context->flags != flags) ||
(context->param != param)) (context->param[0] != param[0]) || (context->param[1] != param[1]))
{ {
sws_freeContext(context); sws_freeContext(context);
context = NULL; context = NULL;

Loading…
Cancel
Save