[FFmpeg-cvslog] swscale: Check memory allocations

Federico Tomassetti git at videolan.org
Tue Feb 17 22:28:50 CET 2015


ffmpeg | branch: master | Federico Tomassetti <f.tomassetti at gmail.com> | Sun Feb 15 19:44:51 2015 +0000| [e51f22122d23589e93ac4f0b3e570bb925755915] | committer: Vittorio Giovara

swscale: Check memory allocations

CC: libav-stable at libav.org
Bug-Id: CID 1267888 / CID 1267890
Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e51f22122d23589e93ac4f0b3e570bb925755915
---

 libswscale/utils.c |    9 +++++++++
 1 file changed, 9 insertions(+)

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);



More information about the ffmpeg-cvslog mailing list