1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00

* modules/video_output/x11/xcommon.c: proper fix for the previous memory leak.

This commit is contained in:
Gildas Bazin 2006-10-08 18:39:01 +00:00
parent ab2bdb9eae
commit 0190d85792

View File

@ -1996,7 +1996,7 @@ static int InitDisplay( vout_thread_t *p_vout )
XPixmapFormatValues * p_formats; /* pixmap formats */
XVisualInfo * p_xvisual; /* visuals information */
XVisualInfo xvisual_template; /* visual template */
int i_count; /* array size */
int i_count, i; /* array size */
#endif
#ifdef HAVE_SYS_SHM_H
@ -2102,18 +2102,18 @@ static int InitDisplay( vout_thread_t *p_vout )
p_formats = XListPixmapFormats( p_vout->p_sys->p_display, &i_count );
p_vout->p_sys->i_bytes_per_pixel = 0;
for( ; i_count-- ; p_formats++ )
for( i = 0; i < i_count; i++ )
{
/* Under XFree4.0, the list contains pixmap formats available
* through all video depths ; so we have to check against current
* depth. */
if( p_formats->depth == (int)p_vout->p_sys->i_screen_depth )
if( p_formats[i].depth == (int)p_vout->p_sys->i_screen_depth )
{
if( p_formats->bits_per_pixel / 8
if( p_formats[i].bits_per_pixel / 8
> (int)p_vout->p_sys->i_bytes_per_pixel )
{
p_vout->p_sys->i_bytes_per_pixel =
p_formats->bits_per_pixel / 8;
p_formats[i].bits_per_pixel / 8;
}
}
}