summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-03-12 13:46:13 +0100
committerLuca Barbato <lu_zero@gentoo.org>2016-03-15 16:06:35 +0100
commit8b4b1c1eea9daa4e2003aa0935e73f56aab8102d (patch)
treeb610b86ba4ae6eaf5ae966b00278e39137bd11ae /libavformat
parent92c1a83ee9394b39d68f6affd9104752a03714f8 (diff)
matroska: Support V_QUICKTIME as written in the specification
Check if the size is written the first 4 bytes and read the next 4 as fourcc candidate, fallback checking the initial for 4 bytes. "The CodecPrivate contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory video descriptor structure (starting with the size and FourCC fields)" CC: libav-stable@libav.org
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 0ed56af1bd..75ac67c89b 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1661,9 +1661,16 @@ static int matroska_parse_tracks(AVFormatContext *s)
} else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
(track->codec_priv.size >= 86) &&
(track->codec_priv.data)) {
- track->video.fourcc = AV_RL32(track->codec_priv.data);
- codec_id = ff_codec_get_id(ff_codec_movvideo_tags,
- track->video.fourcc);
+ if (track->codec_priv.size == AV_RB32(track->codec_priv.data)) {
+ track->video.fourcc = AV_RL32(track->codec_priv.data + 4);
+ codec_id = ff_codec_get_id(ff_codec_movvideo_tags,
+ track->video.fourcc);
+ }
+ if (codec_id == AV_CODEC_ID_NONE) {
+ track->video.fourcc = AV_RL32(track->codec_priv.data);
+ codec_id = ff_codec_get_id(ff_codec_movvideo_tags,
+ track->video.fourcc);
+ }
if (codec_id == AV_CODEC_ID_NONE) {
char buf[32];
av_get_codec_tag_string(buf, sizeof(buf), track->video.fourcc);