changeset 8579:8f6e84a2a431

do not config video out system if input dimensions are invalid (triggered a segfault in vop_expand due to missing dimension checks, which bug was reported by gabucino)
author alex
date Fri, 27 Dec 2002 17:31:52 +0000
parents a9d454af3497
children 220caf4ce5fc
files libmpcodecs/vd.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd.c	Fri Dec 27 17:28:35 2002 +0000
+++ b/libmpcodecs/vd.c	Fri Dec 27 17:31:52 2002 +0000
@@ -149,8 +149,7 @@
 //    vo_functions_t* video_out=sh->video_out;
     vf_instance_t* vf=sh->vfilter,*sc=NULL;
 
-#if 1
-    if(!(sh->disp_w && sh->disp_h))
+    if(!sh->disp_w || !sh->disp_h)
         mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet);
     /* XXX: HACK, if sh->disp_* aren't set,
      * but we have w and h, set them :: atmos */
@@ -158,7 +157,9 @@
         sh->disp_w=w;
     if(!sh->disp_h && h)
         sh->disp_h=h;
-#endif
+
+    if(!sh->disp_w || !sh->disp_h)
+	return 0;
 
     mp_msg(MSGT_DECVIDEO,MSGL_INFO,MSGTR_VoConfigRequest,w,h,vo_format_name(preferred_outfmt));