aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge2015-12-03 23:04:09 +0200
committerMichael Niedermayer2015-12-04 02:35:20 +0100
commiteb3628d87f67b35e8dd354a466028e93bdd7f9c0 (patch)
treeed5739e548dca9facbc49bf996350a2ef7532d41
parent77a644e6fa4aaeb2c26cfaa0e8ec3b19829b8d88 (diff)
mpegtsenc: Fix off-by-one in indexing into Opus channel mapping arrays
Fixes, CID1338323, CID1338324 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mpegtsenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8591e8cde6..27cd89f403 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -401,11 +401,11 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
if (st->codec->extradata[19] == st->codec->channels - coupled_stream_counts[st->codec->channels] &&
st->codec->extradata[20] == coupled_stream_counts[st->codec->channels] &&
- memcmp(&st->codec->extradata[21], channel_map_a[st->codec->channels], st->codec->channels) == 0) {
+ memcmp(&st->codec->extradata[21], channel_map_a[st->codec->channels-1], st->codec->channels) == 0) {
*q++ = st->codec->channels;
} else if (st->codec->channels >= 2 && st->codec->extradata[19] == st->codec->channels &&
st->codec->extradata[20] == 0 &&
- memcmp(&st->codec->extradata[21], channel_map_b[st->codec->channels], st->codec->channels) == 0) {
+ memcmp(&st->codec->extradata[21], channel_map_b[st->codec->channels-1], st->codec->channels) == 0) {
*q++ = st->codec->channels | 0x80;
} else {
/* Unsupported, could write an extended descriptor here */