Blob Blame Raw
diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/extent.c
--- udftools-1.0.0b3/libudffs/extent.c.extsize	2012-01-26 09:45:22.217856499 +0100
+++ udftools-1.0.0b3/libudffs/extent.c	2012-01-26 09:45:43.142855067 +0100
@@ -50,7 +50,7 @@ cont:
 	while (start_ext != NULL && start_ext->blocks < blocks)
 		start_ext = next_extent(start_ext->next, type);
 
-	if (start_ext->start % offset)
+	if (start_ext != NULL && start_ext->start % offset)
 	{
 		inc = offset - (start_ext->start % offset);
 		if (start_ext->blocks - inc < blocks)
@@ -62,7 +62,7 @@ cont:
 	else
 		inc = 0;
 
-	return start_ext->start + inc;
+	return start_ext ? start_ext->start + inc : NULL;
 }
 
 struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)