[FFmpeg-devel] [PATCH] iff decoder: initialise HAM line decoder with first palette entry

Peter Ross pross at xvid.org
Sun Nov 25 12:04:11 CET 2012


The palette is organised into 'hold' and 'modify' pairs, hence why
the first palette entry is pal[1].

Fixes ticket #1701.

Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavcodec/iff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index afbf643..cf63b77 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -434,7 +434,7 @@ static void decodeplane32(uint32_t *dst, const uint8_t *buf, int buf_size, int p
 static void decode_ham_plane32(uint32_t *dst, const uint8_t  *buf,
                                const uint32_t *const pal, unsigned buf_size)
 {
-    uint32_t delta = 0;
+    uint32_t delta = pal[1]; /* first palette entry */
     do {
         uint32_t first, second;
         DECODE_HAM_PLANE32(0);
-- 
1.8.0

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121125/66bc6926/attachment.asc>


More information about the ffmpeg-devel mailing list