changeset 29544:c7249524c681

Check for return value of initFilter().
author ramiro
date Sat, 29 Aug 2009 23:06:22 +0000
parents 8833a311a140
children 647fc86d3463
files libswscale/swscale.c
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Sat Aug 29 23:03:14 2009 +0000
+++ b/libswscale/swscale.c	Sat Aug 29 23:06:22 2009 +0000
@@ -2812,14 +2812,16 @@
             (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 :
             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,
                    (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC)  : flags,
-                   srcFilter->lumH, dstFilter->lumH, c->param);
-        initFilter(&c->hChrFilter, &c->hChrFilterPos, &c->hChrFilterSize, c->chrXInc,
+                   srcFilter->lumH, dstFilter->lumH, c->param) < 0)
+            goto fail;
+        if (initFilter(&c->hChrFilter, &c->hChrFilterPos, &c->hChrFilterSize, c->chrXInc,
                    c->chrSrcW, c->chrDstW, filterAlign, 1<<14,
                    (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)
 // can't downscale !!!
@@ -2863,14 +2865,16 @@
             (flags & SWS_CPU_CAPS_ALTIVEC) ? 8 :
             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),
                    (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC)  : flags,
-                   srcFilter->lumV, dstFilter->lumV, c->param);
-        initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc,
+                   srcFilter->lumV, dstFilter->lumV, c->param) < 0)
+            goto fail;
+        if (initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc,
                    c->chrSrcH, c->chrDstH, filterAlign, (1<<12),
                    (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
         CHECKED_ALLOC(c->vYCoeffsBank, sizeof (vector signed short)*c->vLumFilterSize*c->dstH);