]> git.sesse.net Git - ffmpeg/commitdiff
Added support for G2M5 codec
authorEric Zimmerman <eric@zimtek.com>
Thu, 9 Oct 2014 17:12:44 +0000 (10:12 -0700)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 24 Oct 2014 17:36:09 +0000 (19:36 +0200)
This has also been independently found and fixed similarly by carl in
f4a3bbf4a3cd375121ea2495817f3e50e831ed48
The 2nd magic check is taken from carls implementation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/g2meet.c
libavformat/riff.c

index 1004e1921e11b05ffeda439c571a4fd0f73f18df..41ad94315021aec9e795994e39c1a8076040b641 100644 (file)
@@ -683,12 +683,12 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
 
     magic = bytestream2_get_be32(&bc);
     if ((magic & ~0xF) != MKBETAG('G', '2', 'M', '0') ||
-        (magic & 0xF) < 2 || (magic & 0xF) > 4) {
+        (magic & 0xF) < 2 || (magic & 0xF) > 5) {
         av_log(avctx, AV_LOG_ERROR, "Wrong magic %08X\n", magic);
         return AVERROR_INVALIDDATA;
     }
 
-    if ((magic & 0xF) != 4) {
+    if ((magic & 0xF) < 4) {
         av_log(avctx, AV_LOG_ERROR, "G2M2 and G2M3 are not yet supported\n");
         return AVERROR(ENOSYS);
     }
index 99fee626fa98f1d7c1bd4e3c10232666f2364dec..c63e406be4688d12b7864f5c97a4fbf6063dfb18 100644 (file)
@@ -360,6 +360,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
     { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '2') },
     { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '3') },
     { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '4') },
+    { AV_CODEC_ID_G2M,          MKTAG('G', '2', 'M', '5') },
     { AV_CODEC_ID_FIC,          MKTAG('F', 'I', 'C', 'V') },
     { AV_CODEC_ID_NONE,         0 }
 };