[MPlayer-cvslog] r38390 - trunk/libmpcodecs/vd.c

reimar subversion at mplayerhq.hu
Fri Aug 26 23:22:37 EEST 2022


Author: reimar
Date: Fri Aug 26 23:22:36 2022
New Revision: 38390

Log:
vd.c: sanity-check aspect adjustment

Ignore unreasonable aspect values > 100 and
ensure the display size is not calculated as 0.
Fixes trac issue #2399.

Modified:
   trunk/libmpcodecs/vd.c

Modified: trunk/libmpcodecs/vd.c
==============================================================================
--- trunk/libmpcodecs/vd.c	Fri Aug 26 19:29:26 2022	(r38389)
+++ trunk/libmpcodecs/vd.c	Fri Aug 26 23:22:36 2022	(r38390)
@@ -332,7 +332,7 @@ int mpcodecs_config_vo(sh_video_t *sh, i
                 screen_size_y = screen_size_xy * sh->disp_h / sh->disp_w;
             }
         }
-        if (sh->aspect >= 0.01) {
+        if (sh->aspect >= 0.01 && sh->aspect <= 100) {
             int w;
             mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_MovieAspectIsSet,
                    sh->aspect);
@@ -350,6 +350,8 @@ int mpcodecs_config_vo(sh_video_t *sh, i
         } else {
             mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_MovieAspectUndefined);
         }
+        if (screen_size_x < 2) screen_size_x = 2;
+        if (screen_size_y < 2) screen_size_y = 2;
     }
 
     vocfg_flags = (fullscreen ? VOFLAG_FULLSCREEN : 0)


More information about the MPlayer-cvslog mailing list