mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-06 22:58:08 +00:00
Fixed #1455 errors in JPEG - more SOI in the file
This commit is contained in:
@@ -30,51 +30,51 @@ import org.testng.annotations.Test;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class JpegFixerTest {
|
||||
|
||||
private JpegFixer fixer = new JpegFixer();
|
||||
|
||||
|
||||
private JpegFixer fixer = new JpegFixer();
|
||||
|
||||
@DataProvider(name = "bytes")
|
||||
public static Object[][] provideSamples() {
|
||||
return new Object[][]{
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI, (byte)0xFF, (byte)SOI, (byte) 0x21, (byte)0xFF, (byte)EOI},
|
||||
new byte[]{(byte)0xFF, (byte)SOI, (byte) 0x21, (byte)0xFF, (byte)EOI},
|
||||
},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI, (byte) 0xFF, (byte) SOI, (byte) 0x21, (byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, (byte) 0x21, (byte) 0xFF, (byte) EOI},},
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI},
|
||||
new byte[]{(byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI},
|
||||
},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI},},
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI, 0x23},
|
||||
new byte[]{(byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI, 0x23},
|
||||
},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI, 0x23},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI, 0x23},},
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)EOI},
|
||||
new byte[]{(byte)0xFF, (byte)EOI},
|
||||
},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) EOI},},
|
||||
{
|
||||
new byte[]{(byte)0xFF},
|
||||
new byte[]{(byte)0xFF},
|
||||
},
|
||||
new byte[]{(byte) 0xFF},
|
||||
new byte[]{(byte) 0xFF},},
|
||||
{
|
||||
new byte[]{(byte)0x26},
|
||||
new byte[]{(byte)0x26},
|
||||
},
|
||||
new byte[]{(byte) 0x26},
|
||||
new byte[]{(byte) 0x26},},
|
||||
{
|
||||
new byte[]{},
|
||||
new byte[]{},
|
||||
new byte[]{},},
|
||||
{
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x27, 0x37, 0x47, 0x57, (byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x27, 0x37, 0x47, 0x57, (byte) 0xFF, (byte) EOI}
|
||||
},
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)SOI, 0x27, 0x37, 0x47, 0x57, (byte)0xFF, (byte)EOI},
|
||||
new byte[]{(byte)0xFF, (byte)SOI, 0x27, 0x37, 0x47, 0x57, (byte)0xFF, (byte)EOI}
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x28, 0x38, (byte) 0xFF, (byte) EOI, (byte) 0xFF, (byte) SOI, 0x48, 0x58, (byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x28, 0x38, 0x48, 0x58, (byte) 0xFF, (byte) EOI}
|
||||
},
|
||||
{
|
||||
new byte[]{(byte)0xFF, (byte)SOI, 0x28, 0x38, (byte)0xFF, (byte)EOI, (byte)0xFF, (byte)SOI, 0x48, 0x58, (byte)0xFF, (byte)EOI},
|
||||
new byte[]{(byte)0xFF, (byte)SOI, 0x28, 0x38, 0x48, 0x58, (byte)0xFF, (byte)EOI}
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x29, (byte) 0xFF, (byte) SOI, 0x39, (byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x29, 0x39, (byte) 0xFF, (byte) EOI},},
|
||||
{
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, (byte) 0xFF, (byte) SOI, 0x2A, (byte) 0xFF, (byte) EOI},
|
||||
new byte[]{(byte) 0xFF, (byte) SOI, 0x2A, (byte) 0xFF, (byte) EOI}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Test(dataProvider = "bytes")
|
||||
public void testFixJpeg(byte[] inputData, byte[] expectedOutput) throws IOException {
|
||||
JpegFixer fixer = new JpegFixer();
|
||||
|
||||
Reference in New Issue
Block a user