mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 11:14:25 +00:00
Return error if trying to create images with negative or overflow sectors on formats that don't support them.
This commit is contained in:
@@ -61,6 +61,20 @@ public sealed partial class Alcohol120
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_imageInfo = new ImageInfo
|
||||
{
|
||||
MediaType = mediaType,
|
||||
|
||||
@@ -58,6 +58,20 @@ public sealed partial class Anex86
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors * sectorSize > int.MaxValue || sectors > (long)int.MaxValue * 8 * 33)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -61,6 +61,20 @@ public sealed partial class Apple2Mg
|
||||
}
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -56,6 +56,20 @@ public sealed partial class AppleDos
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(mediaType != MediaType.Apple32SS && mediaType != MediaType.Apple33SS)
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class Apridisk
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_imageInfo = new ImageInfo
|
||||
{
|
||||
MediaType = mediaType,
|
||||
|
||||
@@ -63,6 +63,20 @@ public sealed partial class Blu
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > 0xFFFFFF)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -75,6 +75,20 @@ public sealed partial class Cdrdao
|
||||
else
|
||||
_separateTracksWriting = false;
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
@@ -487,8 +501,9 @@ public sealed partial class Cdrdao
|
||||
}
|
||||
|
||||
if(_writingTracks != null && _writingStreams != null)
|
||||
foreach(FileStream oldTrack in _writingStreams.Select(t => t.Value).Distinct())
|
||||
oldTrack.Close();
|
||||
{
|
||||
foreach(FileStream oldTrack in _writingStreams.Select(t => t.Value).Distinct()) oldTrack.Close();
|
||||
}
|
||||
|
||||
ulong currentOffset = 0;
|
||||
_writingTracks = [];
|
||||
|
||||
@@ -81,6 +81,20 @@ public sealed partial class CdrWin
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_imageInfo = new ImageInfo
|
||||
{
|
||||
MediaType = mediaType,
|
||||
@@ -422,8 +436,9 @@ public sealed partial class CdrWin
|
||||
}
|
||||
|
||||
if(_writingTracks != null && _writingStreams != null)
|
||||
foreach(FileStream oldTrack in _writingStreams.Select(t => t.Value).Distinct())
|
||||
oldTrack.Close();
|
||||
{
|
||||
foreach(FileStream oldTrack in _writingStreams.Select(t => t.Value).Distinct()) oldTrack.Close();
|
||||
}
|
||||
|
||||
_writingTracks = [];
|
||||
|
||||
|
||||
@@ -56,6 +56,20 @@ public sealed partial class CisCopy
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -62,6 +62,20 @@ public sealed partial class CloneCd
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_imageInfo = new ImageInfo
|
||||
{
|
||||
MediaType = mediaType,
|
||||
|
||||
@@ -63,6 +63,20 @@ public sealed partial class CopyTape
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_imageInfo = new ImageInfo
|
||||
{
|
||||
MediaType = mediaType,
|
||||
|
||||
@@ -63,6 +63,20 @@ public sealed partial class DiskCopy42
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(mediaType)
|
||||
{
|
||||
case MediaType.AppleFileWare:
|
||||
|
||||
@@ -58,6 +58,20 @@ public sealed partial class DriDiskCopy
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > ushort.MaxValue)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
13351
Aaru.Images/Localization/Localization.Designer.cs
generated
13351
Aaru.Images/Localization/Localization.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -2952,4 +2952,10 @@
|
||||
<data name="A2R_Name" xml:space="preserve">
|
||||
<value>A2R</value>
|
||||
</data>
|
||||
<data name="Negative_sectors_are_not_supported" xml:space="preserve">
|
||||
<value>Los sectores negativos no están soportados.</value>
|
||||
</data>
|
||||
<data name="Overflow_sectors_are_not_supported" xml:space="preserve">
|
||||
<value>Los sectores de sobrecarga no están soportados.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2959,4 +2959,10 @@
|
||||
<data name="Vhd_Block_size_Must_be_a_power_of_2" xml:space="preserve">
|
||||
<value>Block size. Must be a power of 2. Only 2MiB and 512KiB are supported by VirtualPC</value>
|
||||
</data>
|
||||
<data name="Negative_sectors_are_not_supported" xml:space="preserve">
|
||||
<value>Negative sectors are not supported.</value>
|
||||
</data>
|
||||
<data name="Overflow_sectors_are_not_supported" xml:space="preserve">
|
||||
<value>Overflow sectors are not supported.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -57,6 +57,20 @@ public sealed partial class MaxiDisk
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > 90 * 2 * 255)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class Nhdr0
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class Parallels
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -60,6 +60,20 @@ public sealed partial class Qcow
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -60,6 +60,20 @@ public sealed partial class Qcow2
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -60,6 +60,20 @@ public sealed partial class Qed
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class RayDim
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > 255 * 255 * 255)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -60,6 +60,20 @@ public sealed partial class RsIde
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > 63 * 16 * 1024)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -231,6 +231,20 @@ public sealed partial class SaveDskF
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > ushort.MaxValue)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class T98
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -61,6 +61,20 @@ public sealed partial class Udif
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -60,6 +60,20 @@ public sealed partial class Vdi
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -215,6 +215,20 @@ public sealed partial class Vhd
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -135,6 +135,20 @@ public sealed partial class VMware
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
@@ -59,6 +59,20 @@ public sealed partial class Virtual98
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectors > uint.MaxValue)
|
||||
{
|
||||
ErrorMessage = Localization.Too_many_sectors;
|
||||
|
||||
@@ -57,6 +57,20 @@ public sealed partial class ZZZRawImage
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negativeSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Negative_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(overflowSectors != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Overflow_sectors_are_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_extension = Path.GetExtension(path)?.ToLower();
|
||||
|
||||
switch(_extension)
|
||||
|
||||
Reference in New Issue
Block a user