[FFmpeg-devel] Stack overflow in VS 2005

Ramiro Ribeiro Polla ramiro
Wed Jul 11 15:36:13 CEST 2007


Hello,

Alexandre Guion wrote:

>Hi all,
>
>
>
>I'm trying to transcode an MJPEG file using ffmpeg under Visual Studio 2005. Other files works great (thanks) but this one triggers a stack overflow error when I run it under windows (either when using VS 2005 or as a stand alone app). It works fine under mingw with the same libraries. Any idea what's going on ?
>
>
>
>I've seen an old post on google concerning a patch for this :
>
>http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-March/024301.html
>
>
>
>The change is committed in SVN now of course, but I still got the problem for this stupid MJPEG file...
>
>
>
>Here's my ffmpeg version if it can help:
>
>FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
>
>  configuration: --enable-shared --disable-static --enable-memalign-hack --enable-liba52 --enable-gpl --enable-libfaac --enable-libfaad --enable-libamr-nb --enable-libamr-wb --enable-swscaler --enable-zlib --enable-libxvid --enable-libx264 --enable-protocols --enable-network --enable-libogg --enable-pp --disable-debug
>
>  libavutil version: 49.4.1
>
>  libavcodec version: 51.40.4
>
>  libavformat version: 51.12.1
>
>  built on Jun 27 2007 14:15:36, gcc: 3.4.5 (mingw special)
>
>
>
>
>
>I'm at the SVN revision #9447
>
>  
>

First of all, this is an usage question, and so it should go to 
ffmpeg-user. There has already been discussion around this a while ago. 
Search the archives.

That is a known issue for linking with FFmpeg libraries under Windows. 
Windows does not provide a properly aligned stack for SSE instructions. 
MinGW tries to align the stack at main(), and gcc preserves alignment 
after that.

Gcc 4.2.0 provides an -mstackrealign option, but we haven't tested yet, 
as we're waiting for MinGW to officially release a gcc 4.2 binary.
You may also try forcing alignment before calls to libav*, but don't ask 
us how =).
If you find a clean way to configure FFmpeg properly on MinGW, patches 
welcome. (note: this shouldn't require change in any code)

Ramiro Polla




More information about the ffmpeg-devel mailing list