shithub: libvpx

Download patch

ref: 262f66e6ed9d2164168455efc65e32f4828c0924
parent: a88e4e64b1e9b248699b4b9a9392946a526844de
parent: 9c061ef5069921e674a0ecf4a375db93461e02e8
author: Yaowu Xu <yaowu@google.com>
date: Tue Jan 6 03:01:30 EST 2015

Merge "Properly validate data size"

--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -148,7 +148,11 @@
     if (frame_marker != VP9_FRAME_MARKER)
       return VPX_CODEC_UNSUP_BITSTREAM;
 
-    if (profile >= MAX_PROFILES) return VPX_CODEC_UNSUP_BITSTREAM;
+    if (profile >= MAX_PROFILES)
+      return VPX_CODEC_UNSUP_BITSTREAM;
+
+    if ((profile >= 2 && data_sz <= 1) || data_sz < 1)
+      return VPX_CODEC_UNSUP_BITSTREAM;
 
     if (vp9_rb_read_bit(&rb)) {  // show an existing frame
       vp9_rb_read_literal(&rb, 3);  // Frame buffer to show.