[FFmpeg-cvslog] Added support for G2M5 codec

Eric Zimmerman git at videolan.org
Fri Oct 24 19:44:30 CEST 2014


ffmpeg | branch: master | Eric Zimmerman <eric at zimtek.com> | Thu Oct  9 10:12:44 2014 -0700| [4ba5420e4d3699b89c9f7f15928cd486f88e9562] | committer: Michael Niedermayer

Added support for G2M5 codec

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ba5420e4d3699b89c9f7f15928cd486f88e9562
---

 libavcodec/g2meet.c |    4 ++--
 libavformat/riff.c  |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 1004e19..41ad943 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -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);
     }
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 99fee62..c63e406 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -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 }
 };



More information about the ffmpeg-cvslog mailing list