Check if the size is written the first 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: [email protected] --- Probably it could be done the other way round and check first that the size is matching and then the fourcc. libavformat/matroskadec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0ed56af..2b0093e 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1664,6 +1664,12 @@ static int matroska_parse_tracks(AVFormatContext *s) 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 && + 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) { char buf[32]; av_get_codec_tag_string(buf, sizeof(buf), track->video.fourcc); -- 2.6.1 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
