Buggy code:
; public static final int [ ] ZigZag8x8 = new int [ ] { 0 , 1 , 8 , 16 , 9 , 2 , 3 , 10 , 17 , 24 , 32 , 25 , 18 , 11 , 4 , 5 , 12 , 19 , 26 , 33 , 40 , 48 , 41 , 34 , 27 , 20 , 13 , 6 , 7 , 14 , 21 , 28 , 35 , 42 , 49 , 56 , 57 , 50 , 43 , 36 , 29 , 22 , 15 , 23 , 30 , 37 , 44 , 51 , 58 , 59 , 52 , 45 , 38 , 31 , 39 , 46 , 53 , 60 , 61 , 54 , 47 , 55 , 62 , 63 } ; public static int [ ] CrRTable ; public static int [ ] CbBTable ; public static int [ ] CrGTable ; public static int [ ] CbGTable ; public static int [ ] RYTable ; public static int [ ] GYTable ; public static int [ ] BYTable ; public static int [ ] RCbTable ; public static int [ ] GCbTable ; public static int [ ] BCbTable ; public static int [ ] RCrTable ; public static int [ ] GCrTable ; public static int [ ] BCrTable ; public static int [ ] NBitsTable ; void compress ( ImageData image , byte [ ] dataYComp , byte [ ] dataCbComp , byte [ ] dataCrComp ) { } void convert4BitRGBToYCbCr ( ImageData image ) { } void convert8BitRGBToYCbCr ( ImageData image ) { } byte [ ] convertCMYKToRGB ( ) { } void convertImageToYCbCr ( ImageData image ) { } void convertMultiRGBToYCbCr ( ImageData image ) { } byte [ ] convertYToRGB ( ) { } byte [ ] convertYCbCrToRGB ( ) { } void decodeACCoefficients ( int [ ] dataUnit , int iComp ) { } void decodeACFirstCoefficients ( int [ ] dataUnit , int iComp , int start , int end , int approxBit ) { } void decodeACRefineCoefficients ( int [ ] dataUnit , int iComp , int start , int end , int approxBit ) { } int refineAC ( int ac , int approxBit ) { } void decodeDCCoefficient ( int [ ] dataUnit , int iComp , boolean first , int approxBit ) { } void dequantize ( int [ ] dataUnit , int iComp ) { } byte [ ] decodeImageComponents ( ) { } void decodeMCUAtXAndY ( int xmcu , int ymcu , int nComponentsInScan , boolean first , int start , int end , int approxBit ) { } void decodeScan ( ) { } int decodeUsingTable ( JPEGHuffmanTable huffmanTable ) { } void emit ( int huffCode , int nBits ) { } void emitByte ( byte byteValue ) { } void encodeACCoefficients ( int [ ] dataUnit , int iComp ) { } void encodeDCCoefficients ( int [ ] dataUnit , int iComp ) { } void encodeMCUAtXAndY ( int xmcu , int ymcu ) { } void encodeScan ( ) { } void expandImageComponents ( ) { } int extendBy ( int diff , int t ) { } void extractData ( int [ ] dataUnit , int iComp , int xmcu , int ymcu , int ihi , int ivi ) { } void forwardDCT ( int [ ] dataUnit ) { } void getAPP0 ( ) { } void getCOM ( ) { } void getDAC ( ) { } void getDHT ( ) { } void getDNL ( ) { } void getDQT ( ) { } void getDRI ( ) { } static void initialize ( ) { } static void initializeBitCountTable ( ) { } static void initializeRGBYCbCrTables ( ) { } static void initializeYCbCrRGBTables ( ) { } void inverseDCT ( int [ ] dataUnit ) { } boolean isFileFormat ( LEDataInputStream stream ) { } boolean isZeroInColumn ( int [ ] dataUnit , int col ) { } boolean isZeroInRow ( int [ ] dataUnit , int rIndex ) { } ImageData [ ] loadFromByteStream ( ) { <START_BUG> if ( true ) { <END_BUG> return JPEGDecoder . loadFromByteStream ( inputStream , loader ) ; } JPEGStartOfImage soi = new JPEGStartOfImage ( inputStream ) ; if ( ! ( soi . verify ( ) ) ) SWT . error ( ERROR_INVALID_IMAGE ) ; restartInterval = 0 ; processTables ( ) ; frameHeader = new JPEGFrameHeader ( inputStream ) ; if ( ! ( frameHeader . verify ( ) ) ) SWT . error ( ERROR_INVALID_IMAGE ) ; imageWidth = frameHeader . getSamplesPerLine ( ) ; imageHeight = frameHeader . getNumberOfLines ( ) ; maxH = frameHeader . getMaxHFactor ( ) ; maxV = frameHeader . getMaxVFactor ( ) ; int mcuWidth = ( maxH ) * ( JPEGFileFormat . DCTSIZE ) ; int mcuHeight = ( maxV ) * ( JPEGFileFormat . DCTSIZE ) ; interleavedMcuCols = ( ( ( imageWidth ) + mcuWidth ) - 1 ) // mcuWidth ; interleavedMcuRows = ( ( ( imageHeight ) + mcuHeight ) - 1 ) // mcuHeight ; progressive = frameHeader . isProgressive ( ) ; samplePrecision = frameHeader . getSamplePrecision ( ) ; nComponents = frameHeader . getNumberOfImageComponents ( ) ; frameComponents = frameHeader . componentParameters ; componentIds = frameHeader . componentIdentifiers ; imageComponents = new byte [ nComponents ] [ ] ; if ( progressive ) { dataUnits = new int [ nComponents ] [ ] [ ] ; } else { dataUnit = new int [ 8 * 8 ] ; } for ( int i = 0 ; i < ( nComponents ) ; i ++ ) { int [ ] frameComponent = frameComponents [ componentIds [ i ] ] ; int bufferSize = ( frameComponent [ JPEGFileFormat . CW ] ) * ( frameComponent [ JPEGFileFormat . CH ] ) ;

Fix:
if ( ( System . getProperty ( "org.eclipse.swt.internal.image.JPEGFileFormat_3.2" ) ) == null ) {