Fix for unhandled error cases when using Media Foundation
Fix for unhandled error cases when using Media Foundation

Some function calls to Media Foundation can fail and retrun null
pointers. They should be checked before being dereferenced to avoid a
crash.

opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv