Skip to content

Commit 895262d

Browse files
authored
Add support for OGG files (#33)
1 parent d6a0b9a commit 895262d

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

src/ByteGuard.FileValidator/FileExtensions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,25 @@ public static class FileExtensions
144144
/// Tag Image File Format.
145145
/// </summary>
146146
public const string Tiff = ".tiff";
147+
148+
/// <summary>
149+
/// Ogg Vorbis Audio.
150+
/// </summary>
151+
public const string Ogg = ".ogg";
152+
153+
/// <summary>
154+
/// Ogg Vorbis Audio.
155+
/// </summary>
156+
public const string Oga = ".oga";
157+
158+
/// <summary>
159+
/// Ogg Video.
160+
/// </summary>
161+
public const string Ogv = ".ogv";
162+
163+
/// <summary>
164+
/// Ogg Multiplex.
165+
/// </summary>
166+
public const string Ogx = ".ogx";
147167
}
148168
}

src/ByteGuard.FileValidator/FileValidator.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,38 @@ public class FileValidator
287287
new byte[] { 0x49, 0x49, 0x2B, 0x00 }, // II+␀ (BigTIFF, Intel byte order)
288288
new byte[] { 0x4D, 0x4D, 0x00, 0x2B } // MM␀+ (BigTIFF, Motorola byte order)
289289
}
290+
},
291+
new FileDefinition
292+
{
293+
FileType = FileExtensions.Ogg,
294+
ValidSignatures = new List<byte[]>
295+
{
296+
new byte[] { 0x4F, 0x67, 0x67, 0x53 } // OggS
297+
}
298+
},
299+
new FileDefinition
300+
{
301+
FileType = FileExtensions.Oga,
302+
ValidSignatures = new List<byte[]>
303+
{
304+
new byte[] { 0x4F, 0x67, 0x67, 0x53 } // OggS
305+
}
306+
},
307+
new FileDefinition
308+
{
309+
FileType = FileExtensions.Ogv,
310+
ValidSignatures = new List<byte[]>
311+
{
312+
new byte[] { 0x4F, 0x67, 0x67, 0x53 } // OggS
313+
}
314+
},
315+
new FileDefinition
316+
{
317+
FileType = FileExtensions.Ogx,
318+
ValidSignatures = new List<byte[]>
319+
{
320+
new byte[] { 0x4F, 0x67, 0x67, 0x53 } // OggS
321+
}
290322
}
291323
};
292324

0 commit comments

Comments
 (0)