Index: trunk/src/com/drew/metadata/tiff/DirectoryTiffHandler.java
===================================================================
--- trunk/src/com/drew/metadata/tiff/DirectoryTiffHandler.java	(revision 13061)
+++ trunk/src/com/drew/metadata/tiff/DirectoryTiffHandler.java	(revision 15217)
@@ -1,4 +1,4 @@
 /*
- * Copyright 2002-2017 Drew Noakes
+ * Copyright 2002-2019 Drew Noakes and contributors
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,4 +24,5 @@
 import com.drew.lang.Rational;
 import com.drew.lang.annotations.NotNull;
+import com.drew.lang.annotations.Nullable;
 import com.drew.metadata.Directory;
 import com.drew.metadata.ErrorDirectory;
@@ -40,10 +41,12 @@
     private final Stack<Directory> _directoryStack = new Stack<Directory>();
 
-    protected Directory _currentDirectory;
+    @Nullable private Directory _rootParentDirectory;
+    @Nullable protected Directory _currentDirectory;
     protected final Metadata _metadata;
 
-    protected DirectoryTiffHandler(Metadata metadata)
+    protected DirectoryTiffHandler(Metadata metadata, @Nullable Directory parentDirectory)
     {
         _metadata = metadata;
+        _rootParentDirectory = parentDirectory;
     }
 
@@ -55,5 +58,5 @@
     protected void pushDirectory(@NotNull Class<? extends Directory> directoryClass)
     {
-        Directory newDirectory = null;
+        Directory newDirectory;
 
         try {
@@ -65,15 +68,20 @@
         }
 
-        if (newDirectory != null)
-        {
-            // If this is the first directory, don't add to the stack
-            if (_currentDirectory != null)
-            {
-                _directoryStack.push(_currentDirectory);
-                newDirectory.setParent(_currentDirectory);
+        // If this is the first directory, don't add to the stack
+        if (_currentDirectory == null) {
+            // Apply any pending root parent to this new directory
+            if (_rootParentDirectory != null) {
+                newDirectory.setParent(_rootParentDirectory);
+                _rootParentDirectory = null;
             }
-            _currentDirectory = newDirectory;
-            _metadata.addDirectory(_currentDirectory);
         }
+        else {
+            // The current directory is pushed onto the stack, and set as the new directory's parent
+            _directoryStack.push(_currentDirectory);
+            newDirectory.setParent(_currentDirectory);
+        }
+
+        _currentDirectory = newDirectory;
+        _metadata.addDirectory(_currentDirectory);
     }
 
