summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorFederico Tomassetti <f.tomassetti@gmail.com>2015-02-15 19:44:51 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-02-17 12:16:43 -0500
commite51f22122d23589e93ac4f0b3e570bb925755915 (patch)
tree36b271896a3cc1a2f05e48e7435b586589621ddb /libswscale
parent3035d21b5a77df0e9531df397fc06d59488996c7 (diff)
downloadffmpeg-streaming-e51f22122d23589e93ac4f0b3e570bb925755915.zip
ffmpeg-streaming-e51f22122d23589e93ac4f0b3e570bb925755915.tar.gz
swscale: Check memory allocations
CC: libav-stable@libav.org Bug-Id: CID 1267888 / CID 1267890 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b3df1af..23d7c93 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1382,6 +1382,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);
OpenPOWER on IntegriCloud