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


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25775 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
benoit 2008-01-17 08:06:09 +00:00
parent 969bc9cb89
commit 6e8c03910d
1 changed files with 6 additions and 1 deletions

View File

@ -2959,12 +2959,17 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
int dstW, int dstH, int dstFormat, int flags,
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->srcW != srcW) || (context->srcH != srcH) ||
(context->srcFormat != srcFormat) ||
(context->dstW != dstW) || (context->dstH != dstH) ||
(context->dstFormat != dstFormat) || (context->flags != flags) ||
(context->param != param))
(context->param[0] != param[0]) || (context->param[1] != param[1]))
{
sws_freeContext(context);
context = NULL;