]> granicus.if.org Git - libvpx/commitdiff
Changed to prevent decoder crash
authorYaowu Xu <yaowu@google.com>
Thu, 23 Jan 2014 23:43:08 +0000 (15:43 -0800)
committerYaowu Xu <yaowu@google.com>
Thu, 23 Jan 2014 23:43:08 +0000 (15:43 -0800)
The change prevent a decoder crash for invalid stream with negative
size.

Change-Id: I7411765f3524c783058fa3d436549be4e75d8969

vp9/decoder/vp9_decodeframe.c

index d66ee27301b6c5395f555c2aaa2e2bb1a73a2619..fa680d9832759f9d2b8f9072ff95728f5283a7de 100644 (file)
@@ -743,7 +743,7 @@ static void setup_frame_size_with_refs(VP9D_COMP *pbi,
   if (!found)
     read_frame_size(rb, &width, &height);
 
-  if (!width || !height)
+  if (width <= 0 || height <= 0)
     vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
                        "Referenced frame with invalid size");