Merge commit 'e51f22122d23589e93ac4f0b3e570bb925755915'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 21:21:22 +0000 (22:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 21:22:17 +0000 (22:22 +0100)
* commit 'e51f22122d23589e93ac4f0b3e570bb925755915':
  swscale: Check memory allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/utils.c

index 2174262..c09d37d 100644 (file)
@@ -1591,6 +1591,15 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
         filter->chrV = sws_getIdentityVec();
     }
 
+    if (!filter->lumH || !filter->lumV || !filter->chrH || !filter->chrV) {
+        sws_freeVec(filter->lumH);
+        sws_freeVec(filter->lumV);
+        sws_freeVec(filter->chrH);
+        sws_freeVec(filter->chrV);
+        av_freep(&filter);
+        return NULL;
+    }
+
     if (chromaSharpen != 0.0) {
         SwsVector *id = sws_getIdentityVec();
         sws_scaleVec(filter->chrH, -chromaSharpen);