Merge commit '46191a2da16f751e53d93646ae1388d421d12bee'
authorClément Bœsch <u@pkh.me>
Sat, 29 Apr 2017 10:46:48 +0000 (12:46 +0200)
committerClément Bœsch <u@pkh.me>
Sat, 29 Apr 2017 10:46:48 +0000 (12:46 +0200)
* commit '46191a2da16f751e53d93646ae1388d421d12bee':
  mov: fix a possible invalid read in mov_read_mac_string()

Merged-by: Clément Bœsch <u@pkh.me>
1  2 
libavformat/mov.c

@@@ -162,9 -161,13 +162,13 @@@ static int mov_read_mac_string(MOVConte
  
      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
 +        else if (p < end)
              PUT_UTF8(mac_to_unicode[c-0x80], t, if (p < end) *p++ = t;);
      }
      *p = 0;