diff 4xm.c @ 5611:c94931b2f2e5 libavcodec

Change 4xm demuxer and video decoder to pass the video format version in extradata instead of codec_tag.
author rtogni
date Mon, 27 Aug 2007 21:58:39 +0000
parents 9b20d2534c97
children 8ca682e4911d
line wrap: on
line diff
--- a/4xm.c	Mon Aug 27 10:39:31 2007 +0000
+++ b/4xm.c	Mon Aug 27 21:58:39 2007 +0000
@@ -789,7 +789,12 @@
 static int decode_init(AVCodecContext *avctx){
     FourXContext * const f = avctx->priv_data;
 
-    f->version= avctx->codec_tag == 0x40000;
+    if(avctx->extradata_size != 4 || !avctx->extradata) {
+        av_log(avctx, AV_LOG_ERROR, "extradata wrong or missing\n");
+        return 1;
+    }
+
+    f->version= AV_RL32(avctx->extradata) == 0x40000;
     common_init(avctx);
     init_vlcs(f);