Bug 1063327 - Reject vp9 frames with invalid tiles. r=kinetik, a=sledru
authorRalph Giles <giles@mozilla.com>
Wed, 01 Oct 2014 17:28:03 -0700
changeset 216913 16aa4dfa9001
parent 216912 ff91afbb6355
child 216914 fa58aaa6863e
push id3964
push userrgiles@mozilla.com
push date2014-10-02 16:01 +0000
treeherdermozilla-beta@16aa4dfa9001 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1063327
milestone33.0
Bug 1063327 - Reject vp9 frames with invalid tiles. r=kinetik, a=sledru
media/libvpx/vp9/decoder/vp9_decodframe.c
--- a/media/libvpx/vp9/decoder/vp9_decodframe.c
+++ b/media/libvpx/vp9/decoder/vp9_decodframe.c
@@ -863,16 +863,21 @@ static size_t get_tile(const uint8_t *co
 
   if (!is_last) {
     if (!read_is_valid(*data, 4, data_end))
       vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME,
           "Truncated packet or corrupt tile length");
 
     size = read_be32(*data);
     *data += 4;
+
+    if (size > data_end - *data) {
+      vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME,
+          "Truncated packet or corrupt tile size");
+    }
   } else {
     size = data_end - *data;
   }
   return size;
 }
 
 typedef struct TileBuffer {
   const uint8_t *data;