[FFmpeg-devel] [PATCH] Smacker video decoder bug fix

Daniel Verkamp daniel
Mon Dec 15 09:17:22 CET 2008


Hi,

Here is a patch to fix a small bug in the Smacker video decoder; some
blocks were out of order in a sample I created with the current RAD
Video Tools.

The fix is just to reorder the colors of the two blocks in this case.

Before and after screenshot: http://drv.nu/temp/smacker-bug-before-after.png

Smaller (~2.5 MB) sample that reproduces the issue:
http://drv.nu/temp/high_voltage_disconnect_switch.smk

Thanks,
-- Daniel Verkamp

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 5de3769..bcdf792 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -457,8 +457,8 @@ static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size, const
                 case 2:
                     for(i = 0; i < 2; i++) {
                         uint16_t pix1, pix2;
-                        pix1 = smk_get_code(&gb, smk->full_tbl,
smk->full_last);
                         pix2 = smk_get_code(&gb, smk->full_tbl,
smk->full_last);
+                        pix1 = smk_get_code(&gb, smk->full_tbl,
smk->full_last);
                         AV_WL16(out,pix1);
                         AV_WL16(out+2,pix2);
                         out += stride;




More information about the ffmpeg-devel mailing list