Module: libav
Branch: master
Commit: 0266988ccd15436eaf5f7bb6f9509e6bfd5ce589

Author:    Ferdinand Oeinck <[email protected]>
Committer: Vittorio Giovara <[email protected]>
Date:      Tue Apr  7 12:42:17 2015 +0200

hqx: Fix clipping error in idct put function

Signed-off-by: Vittorio Giovara <[email protected]>

---

 libavcodec/hqx.c               |    2 +-
 tests/ref/fate/canopus-hqx422a |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index 3feb287..3de3dc2 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -182,7 +182,7 @@ static void hqx_idct_put(uint16_t *dst, ptrdiff_t stride,
 
     for (i = 0; i < 8; i++) {
         for (j = 0; j < 8; j++) {
-            int v = av_clip(block[j + i * 8] + 0x800, 0, 0x1000);
+            int v = av_clip(block[j + i * 8] + 0x800, 0, 0xFFF);
             dst[j] = (v << 4) | (v >> 8);
         }
         dst += stride >> 1;
diff --git a/tests/ref/fate/canopus-hqx422a b/tests/ref/fate/canopus-hqx422a
index 29dc307..0fd2577 100644
--- a/tests/ref/fate/canopus-hqx422a
+++ b/tests/ref/fate/canopus-hqx422a
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,  8294400, 0x9b38264d
+0,          0,          0,        1,  8294400, 0x9a22bebf

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

Reply via email to