]> git.sesse.net Git - ffmpeg/commitdiff
Check for allocation failure for c->lumMmx2FilterCode and c->chrMmx2FilterCode.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 8 Mar 2010 19:41:57 +0000 (19:41 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 8 Mar 2010 19:41:57 +0000 (19:41 +0000)
Originally committed as revision 30864 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/utils.c

index 2b9f272825d909b555428e7655558523d2d91e27..5409980eb1f797cf5876b6a793347b6b9ff4ef7c 100644 (file)
@@ -968,6 +968,8 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
             c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize);
 #endif
 
+            if (!c->lumMmx2FilterCode || !c->chrMmx2FilterCode)
+                goto fail;
             FF_ALLOCZ_OR_GOTO(c, c->hLumFilter   , (dstW        /8+8)*sizeof(int16_t), fail);
             FF_ALLOCZ_OR_GOTO(c, c->hChrFilter   , (c->chrDstW  /4+8)*sizeof(int16_t), fail);
             FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW      /2/8+8)*sizeof(int32_t), fail);