Skip to content

Commit 55d01f2

Browse files
author
Dmitry Pentin
committed
Added guard clause of empty exif strings
1 parent 210945f commit 55d01f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ImageSharp/Metadata/Profiles/Exif/ExifEncodedStringHelpers.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public static unsafe int Write(Encoding encoding, string value, Span<byte> desti
8484
=> encoding.GetBytes(value.AsSpan(), destination);
8585
#else
8686
{
87+
if (value.Length == 0)
88+
{
89+
return 0;
90+
}
91+
8792
fixed (char* c = value)
8893
{
8994
fixed (byte* b = destination)

0 commit comments

Comments
 (0)