summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-07 09:14:09 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-12-16 22:31:13 +0100
commitdd949124793c722ed55dead9da245574ace81968 (patch)
tree86ffe497d86bc763e07f28ef47e0a8faaa3d7b2f /libavformat/4xm.c
parent0dcd95ef8a2e16ed930296567ab1044e33602a34 (diff)
downloadffmpeg-dd949124793c722ed55dead9da245574ace81968.tar.gz
avformat/4xm: Check for duplicate track ids
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 848991af5b..e307560014 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);