提交 9267e2ff 编写于 作者: A Andreas Rheinhardt

avcodec/flashsv2enc: Fix use of uninitialized value

Before 257a83b9, certain buffers were
zero-allocated in the init function and only reallocated lateron if they
turned out to be too small; now they are only allocated during init,
leading to use-of-uninitialized values lateron. The same could happen
before if the dimensions are big enough so that the buffers would be
reallocated, as the new part of the reallocated buffer would not be
zeroed (happened for 960x960). So always zero the buffers in the
function designed to init them.
Reviewed-by: NMarton Balint <cus@passwd.hu>
Signed-off-by: NAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
上级 eccc7971
......@@ -142,6 +142,7 @@ static void init_blocks(FlashSV2Context * s, Block * blocks,
{
int row, col;
Block *b;
memset(blocks, 0, s->cols * s->rows * sizeof(*blocks));
for (col = 0; col < s->cols; col++) {
for (row = 0; row < s->rows; row++) {
b = blocks + (col + row * s->cols);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册