summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-04-29 12:46:48 +0200
committerClément Bœsch <u@pkh.me>2017-04-29 12:46:48 +0200
commite166fe2e1f0ae175a6b7f1f4b137c1366fd7f633 (patch)
treed5d7d31dfade4d09e01122f074a6519925ad3abf
parent5729acee8214170f212b6409ac363428152d05ff (diff)
parent46191a2da16f751e53d93646ae1388d421d12bee (diff)
Merge commit '46191a2da16f751e53d93646ae1388d421d12bee'
* commit '46191a2da16f751e53d93646ae1388d421d12bee': mov: fix a possible invalid read in mov_read_mac_string() Merged-by: Clément Bœsch <u@pkh.me>
-rw-r--r--libavformat/mov.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 03fd90e3d3..afef53b79a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -162,7 +162,11 @@ static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len,
for (i = 0; i < len; i++) {
uint8_t t, c = avio_r8(pb);
- if (c < 0x80 && p < end)
+
+ if (p >= end)
+ continue;
+
+ if (c < 0x80)
*p++ = c;
else if (p < end)
PUT_UTF8(mac_to_unicode[c-0x80], t, if (p < end) *p++ = t;);