summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-07 09:14:09 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-06 20:27:35 +0200
commit59287d3880966cc70d6080a28649c66025987bc8 (patch)
treea2b2cf7a8209bef88f69cdb8db823b5fc0398020
parent8f83d2a94a8113ca61633b3cf7bf04cdeb0466dd (diff)
downloadffmpeg-59287d3880966cc70d6080a28649c66025987bc8.tar.gz
avformat/4xm: Check for duplicate track ids
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit dd949124793c722ed55dead9da245574ace81968) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/4xm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 9dc4f05d3b..cfee8a02f4 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -149,6 +149,9 @@ static int parse_strk(AVFormatContext *s,
memset(&fourxm->tracks[fourxm->track_count], 0,
sizeof(AudioTrack) * (track + 1 - fourxm->track_count));
fourxm->track_count = track + 1;
+ } else {
+ if (fourxm->tracks[track].bits)
+ return AVERROR_INVALIDDATA;
}
fourxm->tracks[track].adpcm = AV_RL32(buf + 12);
fourxm->tracks[track].channels = AV_RL32(buf + 36);