[FFmpeg-devel] avcodec_decode_video crash when using ffmpeg libraries with MSVC 2008 project

Alex Guion aguion
Mon Jun 22 17:35:09 CEST 2009

Hi all,

I'm using the ffmpeg libraries in a MSVC 2008 project (therefore linked to msvcrt90.dll, if that has any consequences), the libraries have been compiled using Mings+MSYS with gcc version 4.2.1 (I also tried with 3.4.5 and 4.4.0 versions). The version is the release 0.5 that the ffmpeg team released a few weeks ago (thanks again!)

 I was trying to decode a simple flv file taken from youtube and when ffmpeg is handling the file completely (using av_open_input_file), the decoding is done by ffmpeg just fine, until the end of the video.
However when I do the demuxing myself (I need to bypass av_open_input_file for my own reasons), the avcodec_decode_video will crash at random places in the video that will differ between 2 tests. I'm pretty sure that my demuxing is done fine though and the weird thing is that if I run MSVC in debug mode, the crash doesn't appear anymore. In release mode  it will happen in the first 2 or 3 minutes.

I've tried disabling all the optimizations, thread support and also tried to integrate the static libraries instead of using the shared version. I've tried gcc 3.4.5, 4.2.2 and 4.4.0 for MingW, nothing worked.

Here's my configuration:
./configure --enable-memalign-hack --enable-shared --disable-static --disable-debug --enable-gpl --enable-postproc --enable-w32threads --enable-protocols --enable-yasm --enable-libmp3lame --enable-zlib --enable-libfaad --enable-libfaac --enable-libx264 --enable-nonfree --enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-swscale --extra-cflags=-DUNICODE --extra-cflags="-fno-common"

I tried to track down the crash (I don't have the stack) and it's somewhere in the h263 video decoding but I can't narrow it down much more. Would anyone have any idea of what's going on, and if it could be a configuration/compilation issue between MingW and MSVC compilers?

Any help would be appreciated, thanks!

Alex Guion

More information about the ffmpeg-devel mailing list