diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-27 03:12:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-10 02:13:09 +0200 |
commit | 852ef62b85c04eb37dbe337ff0d8a59d459a7d29 (patch) | |
tree | fe6a176da24a3723bc46c6c121037eba0b1be680 | |
parent | 45432879ff415ec3e91d66ef5a19219ba7563ab9 (diff) | |
download | ffmpeg-852ef62b85c04eb37dbe337ff0d8a59d459a7d29.tar.gz |
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@gmx.at>
(cherry picked from commit 007498fc1a639ecee2cda1892cbcff66c7c8c951)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswscale/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 05ec6ca7a8..aa3d10ab46 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1251,7 +1251,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 && |