C++ Standards, Extensions, and Interop


Access violation reading location 0xbaadf00d


Hi,Iam writing some test application for the below filtergraph.
filesourceasynch-->demux-->sinkfilter
but its geting crashed and showing the below exception:
Unhandled exception at 0x10003230 in testaudio.exe: 0xC0000005: Access violation reading location 0xbaadf00d.
And the line of code it is pointing to:
hr = m_pGraphBuilder->ConnectDirect(GetPin(m_pFileSourceAsynch,L
"Output"),GetPin(m_pDemux,L"Input"),
NULL);
kindly reply asap.i need to fix it very soon.
jyothiapu
hi..thanks both..i got it solved..I dint register rtp based filters in my view.this is also a cause for that exception.thanks again for the info provided..jyothiapu
This is an indicator that you are reading from uninitialized memory.SDET Windows C++ CodeGenerationTeam - Performance
hi,yeah.I have seen some related posts.I found that some uninitialized pointer or memory is trying to be accessed.but i dont know how to resolve this.Iam completely new to this.
below is the block of code which is wrong
HRESULT cgraphtest ::ConnectGraph()
{
HRESULT hr = S_OK;
hr = m_pGraphBuilder->ConnectDirect(GetPin(m_pFileSourceAsynch,L
"Output"),GetPin(m_pDemux,L"Input"),
NULL);
if(FAILED(hr))
{
goto FX_EXIT;
}
in header file i declared as follows:
IGraphBuilder *m_pGraphBuilder;
pl take time 2 help me out.
jyothiapu
You have not initialized your IGraphBuilder interface pointer, so it is pointing at garbage and not a
DirectShow GraphBuilder interface.
Using the debugger, check the value of m_pGraphBuilder. Is it NULL? or garbage?
Where is m_pGraphBuilder initialized?
Hi thanks for the reply.all the below lines of code are already existing.Is there something else I need to add?
EXTERN_C
const IID IID_IGraphBuilder;
IGraphBuilder *m_pGraphBuilder;
typedef interface IGraphBuilder IGraphBuilder;
IGraphBuilder : public IFilterGraph
{---}
hi brian,i found the value of m_pgraphbulider as 0x00362e98.when i traced the code its working fine for 2 times and crashing the 3rd time pointing to
hr = m_pGraphBuilder->ConnectDirect(GetPin(m_pFileSourceAsynch,L
"Output"),GetPin(m_pDemux,L"Input"
), NULL);
jyothiapu
DirectShow uses the Component Object Model (COM) to interface to clients. You have not shown any code to initialize COM, or to obtain the interface pointer.
This:
IGraphBuilder *m_pGraphBuilder;
Only tells us that m_pGraphBuilder is a pointer to an IGraphBuilder. It does not create anything, and the pointer is not pointing at anything at all -- it is uninitialized, so its value is indeterminate.
0xbaadf00d is a sentinel value used by Microsoft code to mark uninitialized heap memory, so...your question sort of answers itself. 0xdeadbeef is another sentinel, but I do not recall who uses it. It is always best not to rely on uninitialized memory.
There is plenty of documentation on how to write a COM client and how to ply DirectShow.
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/directshow/htm/directshowtutorials.htm
The online search is not working now...so, I cannot find you a tutorial here, but...type "DirectShow Tutorial" into a Bing box.
common memory patterns (this is a link to wikipedia)
A couple of memory patterns utilized by Microsoft on the list:
0xBAADF00D Used by Microsoft's LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory
0xDEADBEEF marks freed kernel memory (KMEM_FREE_PATTERN)
0xFDFDFDFD Used by Microsoft's C++ debugging heap to mark "no man's land" guard bytes before and after allocated heap memory
SDET Windows C++ CodeGenerationTeam - Performance
hi..thanks both..i got it solved..I dint register rtp based filters in my view.this is also a cause for that exception.thanks again for the info provided..jyothiapu

Related Links

LNK2001 ?
AFX_MANAGE_STATE() macro disturbs the startup position of the ATL dialog
how to change the "Language support for non-Unicode language" in VC
STL vector sizing question
Using Direct2D how would i fill a font with a gradient or radial brush?
Beginner c++ question--Bitwise enumerations
int i = 2; Is this the Assingment Operator here ?
How do you define a template class's constructor outside the class
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
How to use another variable from another Form in VisualC++
Accessing a member through a pointer
How to copy one char* array into another one?
definition of dllimport static data member not allowed
LockFile problem
mspdbsrv.exe consuming over 1.4GB
Visual c++, how to find a file in certain folder and print its name?

Categories

MSDN
Windows Phone Development
Microsoft Azure
.NET Framework
Visual Studio Design a...
Visual FoxPro
Data Platform Development
Machine Translation an...
Development
Office Live Development
Unified Communications
Other Forums
Archived Forums I-L
Archived Forums X-Z
Visual Studio Tools fo...
Payouts and Reporting
Windows Desktop Optica...
Windows Desktop Sideba...
User Interface develop...
Windows Desktop Pro-Au...
Windows Desktop Web Se...
Windows Desktop Winsoc...
Development with the W...
SharePoint 2013 - Gene...
Azure Networking (DNS,...
Microsoft Azure Site R...
Azure Marketplace
Azure CDN
Azure DocumentDB
Cognitive Services
Azure Security Center
Azure DevTest Labs
Azure Blockchain
Publishing Apps for th...
.NET Framework Setup a...
Team Foundation Server...
ADO.NET Managed Providers
Microsoft Translator D...
Training and Certifica...
SyncFx – Microsoft Syn...
Microsoft Robotics - D...
Microsoft Robotics - S...
Microsoft Device Emulator
Visual Studio Smart De...
Visual Studio Smart De...
Data Mining
SQL Server XML
SQL Server Migration
Standard 2009: Embedde...
Windows Embedded Compa...
SQL Server 2012 Setup ...
SQL Server 2012 High A...
SQL Server 2012 SQL To...
Windows Live Writer: D...
CRM Deployment
WebsitePanel - Discuss...
Microsoft Automatic Gr...
Bing Maps General
Open Specifications Qu...
Exchange Server Develo...
Programming Silverligh...
Expression Web and Sup...
Expression Media
Surface Application De...
Retired SharePoint Acc...
Retired SharePoint Col...
.NET Platform Architec...
Architecture Events
Architecture, Tools, a...
Azure Troubleshooting,...
Azure Startups
Building Windows Store...
Crystal Reports for Vi...
Dryad, DSC, and DryadL...
Chart Controls for .NE...
Feedback for Visual Ba...
Game Technologies: Gen...
Game Technologies: XNA...
Innovate on Office
LightSwitch in Visual ...
LINQ Project General
LINQ to SQL (Pre-Release)
LightSwitch HTML Clien...
Microsoft ESP Platform...
POS for .NET
Parallel Programming w...
SQL Azure Labs Support
SQL Server 2014 In Azu...
SQL Server 2014 Self-S...
Visual Basic IDE
Visual C# Language
Visual C++ 2008 (Pre-r...
Visual Studio 2008 SP1...
Visual Studio Database...
Visual Studio LightSwi...
WCF Data Services (Pre...
Windows Developer Prev...
Windows Live Controls ...
Windows Presentation F...
Building Windows Store...
Tools for Windows Stor...
Windows Phone Preview ...
Windows Phone Preview SDK
Microsoft R Open
Microsoft Graph

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile