Bug 1057174 - [WebRTC] |DesktopDeviceInfoImpl::initializ| in desktop_device_info.cc use wrong argument while calling snprintf. r=rjesup, a=sledru
authorChia-hung Tai <ctai@mozilla.com>
Fri, 22 Aug 2014 10:08:24 +0800
changeset 216716 645d232705b3
parent 216715 40044a225ae7
child 216717 0af2575571f3
push id3889
push userryanvm@gmail.com
push date2014-09-15 13:57 +0000
treeherdermozilla-beta@0af2575571f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrjesup, sledru
bugs1057174
milestone33.0
Bug 1057174 - [WebRTC] |DesktopDeviceInfoImpl::initializ| in desktop_device_info.cc use wrong argument while calling snprintf. r=rjesup, a=sledru
media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info.cc
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info.cc
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_device_info.cc
@@ -233,21 +233,21 @@ int32_t DesktopDeviceInfoImpl::initializ
       DesktopDisplayDevice *pWinDevice = new DesktopDisplayDevice;
       if (!pWinDevice) {
         continue;
       }
 
       pWinDevice->setScreenId(itr->id);
       pWinDevice->setDeviceName(itr->title.c_str());
 
-      char idStr[64];
+      char idStr[BUFSIZ];
 #if XP_WIN
       _snprintf_s(idStr, sizeof(idStr), sizeof(idStr) - 1, "\\win\\%ld", pWinDevice->getScreenId());
 #else
-      snprintf(idStr, BUFSIZ, "\\win\\%ld", pWinDevice->getScreenId());
+      snprintf(idStr, sizeof(idStr), "\\win\\%ld", pWinDevice->getScreenId());
 #endif
       pWinDevice->setUniqueIdName(idStr);
       desktop_window_list_[pWinDevice->getScreenId()] = pWinDevice;
     }
   }
 
   return 0;
 }