From 266f6eefc603dd3c34be7de94eec5c9c293b80f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 5 Nov 2011 23:51:05 +0100 Subject: [PATCH] nuv: do not use data not initialized by LZO decompression. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes visible corruption in the incomplete last frame of the FATE sample. Signed-off-by: Reimar Döffinger --- libavcodec/nuv.c | 2 +- tests/ref/fate/nuv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 64956f916f..b10b8db248 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -187,7 +187,7 @@ retry: if (av_lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen)) av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); buf = c->decomp_buf; - buf_size = c->decomp_size - AV_LZO_OUTPUT_PADDING; + buf_size = c->decomp_size - AV_LZO_OUTPUT_PADDING - outlen; } if (c->codec_frameheader) { int w, h, q, res; diff --git a/tests/ref/fate/nuv b/tests/ref/fate/nuv index b047378954..69854f2b8f 100644 --- a/tests/ref/fate/nuv +++ b/tests/ref/fate/nuv @@ -25,6 +25,6 @@ 1, 29257, 4096, 0xd95a9277 0, 30030, 460800, 0x4b7f4df0 1, 31347, 4096, 0xae2bef2c -0, 33033, 460800, 0xb30eb322 +0, 33033, 460800, 0xa57f20d0 1, 33437, 4096, 0xbf031e83 1, 35527, 4096, 0x4c83e2d1