# HG changeset patch # User iive # Date 1087833835 0 # Node ID 55b9c352d019d66a7d31a8d6c41ff694c115f45b # Parent 4b4c748da9908fe36e45d79eb66a87e6a519114c width and height in seq_header could never be 0 diff -r 4b4c748da990 -r 55b9c352d019 libmpeg2/header.c --- 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);