Bug 1181265 - Wallpaper over windows (driver?) returning null ptr to GetStreamCaps. r=pkerr, a=lmandel
authorRandell Jesup <rjesup@jesup.org>
Thu, 09 Jul 2015 14:23:58 -0400
changeset 275412 7e104f2019d2ebecb15055f56f8b15966e81e7be
parent 275411 ad8e3522ff7c0782720dedd0b93eea8694d53ca3
child 275413 f8552cb1f75e87209f62e6cc0c51ee9d5f4efe05
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspkerr, lmandel
bugs1181265
milestone40.0
Bug 1181265 - Wallpaper over windows (driver?) returning null ptr to GetStreamCaps. r=pkerr, a=lmandel
media/webrtc/trunk/webrtc/modules/video_capture/windows/device_info_ds.cc
--- a/media/webrtc/trunk/webrtc/modules/video_capture/windows/device_info_ds.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/windows/device_info_ds.cc
@@ -487,17 +487,18 @@ int32_t DeviceInfoDS::CreateCapabilityMa
     bool supportFORMAT_VideoInfo2 = false;
     bool supportFORMAT_VideoInfo = false;
     bool foundInterlacedFormat = false;
     GUID preferedVideoFormat = FORMAT_VideoInfo;
     for (int32_t tmp = 0; tmp < count; ++tmp)
     {
         hr = streamConfig->GetStreamCaps(tmp, &pmt,
                                          reinterpret_cast<BYTE*> (&caps));
-        if (!FAILED(hr))
+        // Bug 1181265 - perhaps a helper dll returns success with nullptr
+        if (!FAILED(hr) && pmt)
         {
             if (pmt->majortype == MEDIATYPE_Video
                 && pmt->formattype == FORMAT_VideoInfo2)
             {
                 WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, _id,
                              " Device support FORMAT_VideoInfo2");
                 supportFORMAT_VideoInfo2 = true;
                 VIDEOINFOHEADER2* h =