changeset 6197:48d0e89e8b21

report error if bad dimensions requested (<=0)
author alex
date Sun, 26 May 2002 15:55:29 +0000
parents f01f6fd93ce8
children c538e5635189
files libmpcodecs/vf_vo.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_vo.c	Sun May 26 13:41:08 2002 +0000
+++ b/libmpcodecs/vf_vo.c	Sun May 26 15:55:29 2002 +0000
@@ -18,6 +18,12 @@
         int width, int height, int d_width, int d_height,
 	unsigned int flags, unsigned int outfmt){
 
+    if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0))
+    {
+	mp_msg(MSGT_CPLAYER, MSGL_ERR, "VO: invalid dimensions!\n");
+	return 0;
+    }
+
   if(video_out->get_info)
   { const vo_info_t *info = video_out->get_info();
     mp_msg(MSGT_CPLAYER,MSGL_INFO,"VO: [%s] %dx%d => %dx%d %s %s%s%s%s\n",info->short_name,