]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix issue 123 (Support Magic-carpet fli version,
authormelanson <melanson@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 4 Sep 2007 17:31:25 +0000 (17:31 +0000)
committermelanson <melanson@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 4 Sep 2007 17:31:25 +0000 (17:31 +0000)
https://roundup.mplayerhq.hu/roundup/ffmpeg/issue123 ) by rearranging the bit depth

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10290 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/flicvideo.c

index e57688fe415747a19171a5b34bc97ed0eef4e358..6d65f6583e2ca5b293dc442d9fbe518244baddda 100644 (file)
@@ -85,18 +85,21 @@ static int flic_decode_init(AVCodecContext *avctx)
     s->avctx = avctx;
 
     s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
-    depth       = AV_RL16(&fli_header[12]);
-
-    if (depth == 0) {
-      depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
-    }
 
+    depth = 0;
     if (s->avctx->extradata_size == 12) {
         /* special case for magic carpet FLIs */
         s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
+        depth = 8;
     } else if (s->avctx->extradata_size != 128) {
         av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
         return -1;
+    } else {
+        depth = AV_RL16(&fli_header[12]);
+    }
+
+    if (depth == 0) {
+        depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
     }
 
     if ((s->fli_type == FLC_FLX_TYPE_CODE) && (depth == 16)) {