[vlc-devel] memory breakage at vlc_stat

Naohiro KORIYAMA nkoriyama at gmail.com
Sat Jan 28 11:01:41 CET 2012

VLC win32 nightly builds (vlc-2.1.0-git-20120128-0411-win32-debug) does not run.

int vlc_stat (const char *filename, struct stat *buf)
 int ret = _wstati64 (wpath, buf);

compiler warning appears here because of incompatible pointer type:
../../extras/package/win32/../../../src/win32/filesystem.c: In
function 'vlc_stat':
warning: passing argument 2 of '_wstati64' from incompatible pointer
note: expected 'struct _stati64 *' but argument is of type 'struct
stat *'

This cause memory breakage.
After passing _wstati64(), filename is broken. I confirmed it with gdb.

Defining stat as _stati64 or using _stati64 explicitly at vlc_stat
fixed this problem.
But I don't know which is better or another better idea exists.
nkoriyama at gmail.com

More information about the vlc-devel mailing list