Heap Corruption (?)

Greetings!

This little nuisance has bothered me for quite some time now - it's regarding a heap corruption (?) when I use DirectShow.

The graph seem to build just fine (looks just fine using GraphEdit), it's not until I call m_pGB->Render (m_pGB being the Graph Builder) that I get four popups about the program triggering a breakpoint, possibly due to heap corruption in Visual Studio 2005. If I chose to "continue" through those four popups, the video renders just fine as it should.

The same error also applies to a simple m_pGB->RenderFile, which I tested to make sure it wasn't somewhere in my graph setup.

Has anyone got any idea whatsoever about what could be causing this?

I'm using Microsoft Platform SDK for Windows Server 2003 R2 (and VStudio 2005) and have compiled the DirectShow baseclasses myself. (this is where I'm thinking it might originate)

When I compile using nmake the release version (strmbase.lib) is roughly 1.2 MB, but if I add the files myself to a solution and make a lib out of it, it becomes roughly 22 MB! (I'm recompiling it via VStudio in order to set the Character Set to "not set" instead of Unicode).

Any hints would be appreciated, as everything works just fine - apart from those four popups about possible heap corruption.

[1319 byte] By [DEVLiN-] at [2007-12-24]
# 1

For further information:

It seems it's somehow related to trying to render a video with MP3 audio in it.

It happens with DivX movies with MP3 audio.
It happens with XVid movies with MP3 audio.
It does not happen with DivX movies with Windows Media Audio V2.
It does not happen with WMV or WMVHD.

Still curious as to how I could get rid of those "heap corruption" or whatever the breaks might be.

DEVLiN- at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 2

I've seen a couple of things that don't sound quite the same but might be relevant.

-- Some versions of the WMF SDK install a heap allocation hook that causes handled exceptions. That sounds like what you are seeing except that I would expect to see it only (mostly) when dealing with WMV streams.

-- Some decoders (including some versions of the DIVX codec) cause a fault if there is a debugger attached to the process, in order to prevent reverse engineering.

G

GeraintDavies at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 3
Geraint Davies wrote:

-- Some decoders (including some versions of the DIVX codec) cause a fault if there is a debugger attached to the process, in order to prevent reverse engineering.

You know what? That was the answer.

I compiled it to a release build and ran it outside of the development environment, a slight flicker for one frame and then the movie started - no errors. Looking at my tests above, I'd reckon it was the MP3 decoder that played tricks on me.

So now my little OpenGL engine happily renders DivX, XVid and WMV-HD as it should.

Thank you!

DEVLiN- at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...

Software Development for Windows Vista

Site Classified