#vulnerable code 
                             void undoFilter() {
		if (ip!=null) {
			ip.reset();
			updateAndDraw();
		}
	} 
                            #location 4 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             void invertLookupTable() {
		int nImages = getStackSize();
		ip.invertLut();
		if (nImages==1)
			ip.invert();
		else {
			ImageStack stack2 = getStack();
			for (int i=1; i<=nImages; i++)
				stack2.getProcessor(i).invert();
			stack2.setColorModel(ip.getColorModel());
		}
	}