sws_scale() renders a frame buffer invalid for memory freeing in a specific situation
|Reported by:||cyril||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Summary of the bug:
After reading small jpegs and then converting them to the BGRA color space using sws_scale(), the resulting frame buffer is corrupted and freeing memory taken by the buffer lead to a debug error.
How to reproduce:
1/ Under Windows 7 and Visual Studio 2010, create a C++ Win32 console app called JpegTest (I'm using VS Pro but it should be ok with VS Express).
2/ Copy-paste the attached JpegTest.cpp within the resulting solution.
3/ Compile the latest FFmpeg to obtain .lib and .dll (or download the latest Zeranoe dev and shared zip)
4/ Configure the solution so it can compile with FFmpeg by configuring the lib and include path (Project > Properties > VC++ Directories).
5/ Don't forget to put the attached inttypes.h in the include path.
6/ Put the dlls in the generated Debug folder
7/ Change JpegTest.cpp so that it properly refers to the root_banner.jpg file.
8/ Launch in debug mode, during execution, you should get a debug breakpoint because of heap corruptions.