From 2fbf69103847d9449de466fa217f8bd4221aa3e9 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Tue, 27 Sep 2011 21:27:17 +0200
Subject: [PATCH] j2kenc: Fix use of value before its initialized.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavcodec/j2kdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 73af6a73df1..998752be1c3 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -701,9 +701,9 @@ static int decode_cblk(J2kDecoderContext *s, J2kCodingStyle *codsty, J2kT1Contex
     for (y = 0; y < height; y++)
         memset(t1->data[y], 0, width*sizeof(int));
 
-    ff_mqc_initdec(&t1->mqc, cblk->data);
     cblk->data[cblk->length] = 0xff;
     cblk->data[cblk->length+1] = 0xff;
+    ff_mqc_initdec(&t1->mqc, cblk->data);
 
     while(passno--){
         switch(pass_t){
-- 
GitLab