aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dsfdec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2014-04-18 15:56:28 +1000
committerMichael Niedermayer <michaelni@gmx.at>2014-04-18 14:33:57 +0200
commit0a13487b1a2dae29fc5b27cb32253b10f08d17f8 (patch)
tree518c90f8a28d120bc59fddd2429f24c6064d44b4 /libavformat/dsfdec.c
parent941b2240f2ce59c41f4a9ffec88c512f64c75613 (diff)
downloadffmpeg-0a13487b1a2dae29fc5b27cb32253b10f08d17f8.tar.gz
avformat/dsddec: create audio stream before processing id3
This ensures stream[0] is always the audio stream (an assumption made in dsf_read_packet). Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dsfdec.c')
-rw-r--r--libavformat/dsfdec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/dsfdec.c b/libavformat/dsfdec.c
index 74fd7aa7d7..fee551df35 100644
--- a/libavformat/dsfdec.c
+++ b/libavformat/dsfdec.c
@@ -70,6 +70,11 @@ static int dsf_read_header(AVFormatContext *s)
if (avio_rl64(pb) != 28)
return AVERROR_INVALIDDATA;
+ /* create primary stream before any id3 coverart streams */
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
avio_skip(pb, 8);
id3pos = avio_rl64(pb);
if (pb->seekable) {
@@ -92,10 +97,6 @@ static int dsf_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
- st = avformat_new_stream(s, NULL);
- if (!st)
- return AVERROR(ENOMEM);
-
channel_type = avio_rl32(pb);
if (channel_type < FF_ARRAY_ELEMS(dsf_channel_layout))
st->codec->channel_layout = dsf_channel_layout[channel_type];