Commit 1ddb5747 authored by Ramiro Polla's avatar Ramiro Polla

Check for return value of initFilter().

Originally committed as revision 29586 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent dd653355
...@@ -2812,14 +2812,16 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d ...@@ -2812,14 +2812,16 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
(flags & SWS_CPU_CAPS_ALTIVEC) ? 8 : (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 :
1; 1;
initFilter(&c->hLumFilter, &c->hLumFilterPos, &c->hLumFilterSize, c->lumXInc, if (initFilter(&c->hLumFilter, &c->hLumFilterPos, &c->hLumFilterSize, c->lumXInc,
srcW , dstW, filterAlign, 1<<14, srcW , dstW, filterAlign, 1<<14,
(flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags,
srcFilter->lumH, dstFilter->lumH, c->param); srcFilter->lumH, dstFilter->lumH, c->param) < 0)
initFilter(&c->hChrFilter, &c->hChrFilterPos, &c->hChrFilterSize, c->chrXInc, goto fail;
if (initFilter(&c->hChrFilter, &c->hChrFilterPos, &c->hChrFilterSize, c->chrXInc,
c->chrSrcW, c->chrDstW, filterAlign, 1<<14, c->chrSrcW, c->chrDstW, filterAlign, 1<<14,
(flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags,
srcFilter->chrH, dstFilter->chrH, c->param); srcFilter->chrH, dstFilter->chrH, c->param) < 0)
goto fail;
#if defined(COMPILE_MMX2) #if defined(COMPILE_MMX2)
// can't downscale !!! // can't downscale !!!
...@@ -2863,14 +2865,16 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d ...@@ -2863,14 +2865,16 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
(flags & SWS_CPU_CAPS_ALTIVEC) ? 8 : (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 :
1; 1;
initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize, c->lumYInc, if (initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize, c->lumYInc,
srcH , dstH, filterAlign, (1<<12), srcH , dstH, filterAlign, (1<<12),
(flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags,
srcFilter->lumV, dstFilter->lumV, c->param); srcFilter->lumV, dstFilter->lumV, c->param) < 0)
initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc, goto fail;
if (initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc,
c->chrSrcH, c->chrDstH, filterAlign, (1<<12), c->chrSrcH, c->chrDstH, filterAlign, (1<<12),
(flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags,
srcFilter->chrV, dstFilter->chrV, c->param); srcFilter->chrV, dstFilter->chrV, c->param) < 0)
goto fail;
#ifdef COMPILE_ALTIVEC #ifdef COMPILE_ALTIVEC
CHECKED_ALLOC(c->vYCoeffsBank, sizeof (vector signed short)*c->vLumFilterSize*c->dstH); CHECKED_ALLOC(c->vYCoeffsBank, sizeof (vector signed short)*c->vLumFilterSize*c->dstH);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment