aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer2015-02-17 22:21:22 +0100
committerMichael Niedermayer2015-02-17 22:22:17 +0100
commit2a1b79d7e6596033618b23345aa24607f93e1614 (patch)
tree147a8611b3eb40fdeb1c88f00377f755298d18a6
parent880cee004418b7067605cbd9e720aabb0a617164 (diff)
parente51f22122d23589e93ac4f0b3e570bb925755915 (diff)
Merge commit 'e51f22122d23589e93ac4f0b3e570bb925755915'
* commit 'e51f22122d23589e93ac4f0b3e570bb925755915': swscale: Check memory allocations Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswscale/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2174262b01..c09d37d98a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -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);