summaryrefslogtreecommitdiff
path: root/libavcodec/v210dec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-05-10 22:45:07 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-05-17 12:19:38 +0200
commit380ca1bc0ce886f043d1380b7aff99356220309b (patch)
treecbb4d3a16a1833cc64ef06aa1b7eea813677f4b8 /libavcodec/v210dec.c
parentcb944fc7f1327443a0cf449afbce5a3e8712f90f (diff)
downloadffmpeg-380ca1bc0ce886f043d1380b7aff99356220309b.tar.gz
lavc/v210dec: Skip Canopus C210 extradata.
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
Diffstat (limited to 'libavcodec/v210dec.c')
-rw-r--r--libavcodec/v210dec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 99199ddc15..ddc5dbe8be 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -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) {