Index: media/video/capture/file_video_capture_device_factory.cc |
diff --git a/media/video/capture/file_video_capture_device_factory.cc b/media/video/capture/file_video_capture_device_factory.cc |
index 4749c2f8a976b3d9bd9db7fdad57f8466a2e4863..b25a252239dd4cf234632257fd27d0e51dcf522a 100644 |
--- a/media/video/capture/file_video_capture_device_factory.cc |
+++ b/media/video/capture/file_video_capture_device_factory.cc |
@@ -40,7 +40,7 @@ void FileVideoCaptureDeviceFactory::GetDeviceNames( |
VideoCaptureDevice::Names* const device_names) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
DCHECK(device_names->empty()); |
- base::FilePath command_line_file_path = GetFilePathFromCommandLine(); |
+ const base::FilePath command_line_file_path = GetFilePathFromCommandLine(); |
#if defined(OS_WIN) |
device_names->push_back(VideoCaptureDevice::Name( |
base::SysWideToUTF8(command_line_file_path.value()), |
@@ -64,6 +64,8 @@ void FileVideoCaptureDeviceFactory::GetDeviceSupportedFormats( |
DCHECK(thread_checker_.CalledOnValidThread()); |
base::File file = |
FileVideoCaptureDevice::OpenFileForRead(GetFilePathFromCommandLine()); |
+ if (!file.IsValid()) |
+ return; |
VideoCaptureFormat capture_format; |
FileVideoCaptureDevice::ParseFileAndExtractVideoFormat(&file, |
&capture_format); |