diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-05-08 00:59:01 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-05-08 00:59:01 +0400 |
commit | 685c28c60e40481b851e18ec495ecedb6a37791a (patch) | |
tree | 8376fc8440267221987b21953107c0a306de0142 /src/apps/mplayerc/PlayerCaptureDialog.cpp | |
parent | ed6a6799b8510385679b5a46a7b36fd352cb1530 (diff) |
Avoid possible NULL pointer dereferencing (/analyze warning C6011).
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4633 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PlayerCaptureDialog.cpp')
-rw-r--r-- | src/apps/mplayerc/PlayerCaptureDialog.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/apps/mplayerc/PlayerCaptureDialog.cpp b/src/apps/mplayerc/PlayerCaptureDialog.cpp index e50fb9eb1..6a912bab8 100644 --- a/src/apps/mplayerc/PlayerCaptureDialog.cpp +++ b/src/apps/mplayerc/PlayerCaptureDialog.cpp @@ -158,6 +158,9 @@ static void SetupDefaultCaps(AM_MEDIA_TYPE* pmt, VIDEO_STREAM_CONFIG_CAPS& caps) : (pmt->formattype == FORMAT_VideoInfo2)
? &((VIDEOINFOHEADER2*)pmt->pbFormat)->bmiHeader
: NULL;
+ if (!bih) {
+ return;
+ }
caps.guid = GUID_NULL;
caps.VideoStandard = 0;
@@ -713,11 +716,11 @@ void CPlayerCaptureDialog::UpdateMediaTypes() : (pmt->formattype == FORMAT_VideoInfo2)
? &((VIDEOINFOHEADER2*)pmt->pbFormat)->bmiHeader
: NULL;
-
- bih->biWidth = m_vidhor.GetPos();
- bih->biHeight = m_vidver.GetPos();
- bih->biSizeImage = bih->biWidth*bih->biHeight*bih->biBitCount>>3;
-
+ if (bih) {
+ bih->biWidth = m_vidhor.GetPos();
+ bih->biHeight = m_vidver.GetPos();
+ bih->biSizeImage = bih->biWidth*bih->biHeight*bih->biBitCount>>3;
+ }
SaveMediaType(m_VidDisplayName, pmt);
m_mtv = *pmt;
@@ -1430,6 +1433,9 @@ void CPlayerCaptureDialog::OnVideoDimension() : (pvfe->mt.formattype == FORMAT_VideoInfo2)
? &((VIDEOINFOHEADER2*)pvfe->mt.pbFormat)->bmiHeader
: NULL;
+ if (!bih) {
+ return;
+ }
m_vidhor.SetRange(0, 32767);
m_vidver.SetRange(0, 32767);
|