From 02fff499362daedcdcb0a9cdd517257843600563 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 14 Aug 2015 03:20:40 +0200 Subject: [PATCH] avformat/rmdec: Move MLTI handling out of ff_rm_read_mdpr_codecdata() Signed-off-by: Michael Niedermayer --- libavformat/rmdec.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 6b66b953eb..e60b81d141 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -327,20 +327,6 @@ int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb, codec_pos = avio_tell(pb); v = avio_rb32(pb); - if (v == MKBETAG('M', 'L', 'T', 'I')) { - int number_of_streams = avio_rb16(pb); - int number_of_mdpr; - int i; - for (i = 0; ipriv_data = ff_rm_alloc_rmstream(); if (!st->priv_data) return AVERROR(ENOMEM); + + size = avio_rb32(pb); + + ffio_ensure_seekback(pb, 4); + v = avio_rb32(pb); + if (v == MKBETAG('M', 'L', 'T', 'I')) { + int number_of_streams = avio_rb16(pb); + int number_of_mdpr; + int i; + for (i = 0; ipb, st, st->priv_data, - avio_rb32(pb), mime) < 0) + size, mime) < 0) goto fail; break; case MKTAG('D', 'A', 'T', 'A'):