From: Reimar Döffinger <[email protected]>

This fixes visible corruption in the incomplete last frame
of the FATE sample.

Signed-off-by: Anton Khirnov <[email protected]>
---
 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 126904a..7119141 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 f1fcae3..46765f9 100644
--- a/tests/ref/fate/nuv
+++ b/tests/ref/fate/nuv
@@ -18,7 +18,7 @@
 1, 20898, 4096, 0x28f7c6e5
 0, 21021, 460800, 0x4b7f4df0
 1, 22988, 4096, 0xca9d9df2
-0, 24024, 460800, 0xb30eb322
+0, 24024, 460800, 0xa57f20d0
 1, 25078, 4096, 0x5c6b95a9
 1, 27167, 4096, 0x0bdfc0bf
 1, 29257, 4096, 0xd95a9277
-- 
1.7.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to