aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-27 03:12:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-29 03:34:22 +0200
commiteceea69567acc0d8f9368c300d9d52a3b1199512 (patch)
tree2e1c6b149f6af70ff093338da482a479ce2be52b
parent2ec6a7a1e048dab6dd9ef9e4d569e1419eed5e79 (diff)
downloadffmpeg-eceea69567acc0d8f9368c300d9d52a3b1199512.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index ff82deea31..98a9e4d380 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1188,7 +1188,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);
c->srcBpc = 1 + desc_src->comp[0].depth_minus1;
if (c->srcBpc < 8)