changeset 12617:55b9c352d019

width and height in seq_header could never be 0
author iive
date Mon, 21 Jun 2004 16:03:55 +0000
parents 4b4c748da990
children 4a2c715ae125
files libmpeg2/header.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpeg2/header.c	Mon Jun 21 14:07:04 2004 +0000
+++ b/libmpeg2/header.c	Mon Jun 21 16:03:55 2004 +0000
@@ -111,6 +111,10 @@
     i = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2];
     sequence->display_width = sequence->picture_width = width = i >> 12;
     sequence->display_height = sequence->picture_height = height = i & 0xfff;
+
+    if(width == 0 || height == 0)
+        return 1;
+
     decoder->width = sequence->width = width = (width + 15) & ~15;
     decoder->height = sequence->height = height = (height + 15) & ~15;
     decoder->vertical_position_extension = (height > 2800);