[FFmpeg-cvslog] swscale/utils: clear formatConvBuffer on allocation

Michael Niedermayer git at videolan.org
Sat Mar 14 14:41:11 CET 2015


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Fri Feb 27 03:12:23 2015 +0100| [e32e1e3a4fe084d76104285baa58ebb34868d912] | committer: Michael Niedermayer

swscale/utils: clear formatConvBuffer on allocation

Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 007498fc1a639ecee2cda1892cbcff66c7c8c951)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libswscale/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 975a780..f82cc36 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1339,7 +1339,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     c->chrDstW = FF_CEIL_RSHIFT(dstW, c->chrDstHSubSample);
     c->chrDstH = FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample);
 
-    FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
+    FF_ALLOCZ_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
 
     /* unscaled special cases */
     if (unscaled && !usesHFilter && !usesVFilter &&



More information about the ffmpeg-cvslog mailing list