]> git.sesse.net Git - ffmpeg/commitdiff
lavc/v210dec: Skip Canopus C210 extradata.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Thu, 10 May 2018 20:45:07 +0000 (22:45 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Thu, 17 May 2018 10:19:38 +0000 (12:19 +0200)
Unbreaks files with unknown extradata, the Canopus decoder accepts both files
with and without this extradata (24 byte "INFO", 16 byte "RDRT", rest "FIEL").

Reported-by: Peter Bubestinger
Tested-by: Piotr Bandurski
libavcodec/v210dec.c
libavcodec/version.h

index 99199ddc157a766a0ee826aa81108d152df254d0..ddc5dbe8be6c5608b692683939fc4779b6e5ab28 100644 (file)
@@ -27,6 +27,7 @@
 #include "libavutil/bswap.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
+#include "libavutil/intreadwrite.h"
 
 #define READ_PIXELS(a, b, c)         \
     do {                             \
@@ -92,6 +93,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             return AVERROR_INVALIDDATA;
         }
     }
+    if (   avctx->codec_tag == MKTAG('C', '2', '1', '0')
+        && avpkt->size > 64
+        && AV_RN32(psrc) == AV_RN32("INFO")
+        && avpkt->size - 64 >= stride * avctx->height)
+        psrc += 64;
 
     aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf);
     if (aligned_input != s->aligned_input) {
index 3fda743cf9d03f53e60aa85f1e0088647b9b21fc..da893dacf1581b67ac34eec515e1414bb87193d0 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  19
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \