Program: 103716
Project: 103716
Buggy source:
/** 
 * Sets output size.
 * @param size size to set
 */
public void setOutputSize(Dimension size){
  if (size == null)   size=new Dimension(640,480);
  supportedOutputFormats[0]=new YUVFormat(size,-1,Format.byteArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[1]=new YUVFormat(size,-1,Format.intArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[2]=new YUVFormat(size,-1,Format.shortArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[3]=new RGBFormat(size,-1,Format.byteArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[4]=new RGBFormat(size,-1,Format.intArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[5]=new RGBFormat(size,-1,Format.shortArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[6]=new RGBFormat(size,-1,Format.byteArray,-1.0f,24,-1,-1,-1);
  supportedOutputFormats[7]=new RGBFormat(size,-1,Format.intArray,-1.0f,24,-1,-1,-1);
  supportedOutputFormats[8]=new RGBFormat(size,-1,Format.shortArray,-1.0f,24,-1,-1,-1);
  VideoFormat outputFormat=(VideoFormat)getOutputFormat();
  if (outputFormat instanceof RGBFormat) {
    RGBFormat rgbOutputFormat=(RGBFormat)outputFormat;
    setOutputFormat(new RGBFormat(size,Format.NOT_SPECIFIED,outputFormat.getDataType(),outputFormat.getFrameRate(),rgbOutputFormat.getBitsPerPixel(),rgbOutputFormat.getRedMask(),rgbOutputFormat.getGreenMask(),rgbOutputFormat.getBlueMask(),rgbOutputFormat.getPixelStride(),size.width,rgbOutputFormat.getFlipped(),rgbOutputFormat.getEndian()));
  }
 else   if (outputFormat instanceof YUVFormat) {
    YUVFormat yuvOutputFormat=(YUVFormat)outputFormat;
    setOutputFormat(new YUVFormat(size,Format.NOT_SPECIFIED,outputFormat.getDataType(),outputFormat.getFrameRate(),yuvOutputFormat.getYuvType(),Format.NOT_SPECIFIED,Format.NOT_SPECIFIED,0,Format.NOT_SPECIFIED,Format.NOT_SPECIFIED));
  }
 else   if (outputFormat != null)   logger.warn("String_Node_Str" + outputFormat.getClass().getSimpleName() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets output size.
 * @param size size to set
 */
public void setOutputSize(Dimension size){
  if (size == null)   size=new Dimension(640,480);
  supportedOutputFormats[0]=new YUVFormat(size,-1,Format.byteArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[1]=new YUVFormat(size,-1,Format.intArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[2]=new YUVFormat(size,-1,Format.shortArray,-1.0f,YUVFormat.YUV_420,-1,-1,0,-1,-1);
  supportedOutputFormats[3]=new RGBFormat(size,-1,Format.byteArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[4]=new RGBFormat(size,-1,Format.intArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[5]=new RGBFormat(size,-1,Format.shortArray,-1.0f,32,-1,-1,-1);
  supportedOutputFormats[6]=new RGBFormat(size,-1,Format.byteArray,-1.0f,24,-1,-1,-1);
  supportedOutputFormats[7]=new RGBFormat(size,-1,Format.intArray,-1.0f,24,-1,-1,-1);
  supportedOutputFormats[8]=new RGBFormat(size,-1,Format.shortArray,-1.0f,24,-1,-1,-1);
  VideoFormat outputFormat=(VideoFormat)getOutputFormat();
  if (outputFormat instanceof RGBFormat) {
    RGBFormat rgbOutputFormat=(RGBFormat)outputFormat;
    Class<?> dataType=outputFormat.getDataType();
    int bitsPerPixel=rgbOutputFormat.getBitsPerPixel();
    int pixelStride=rgbOutputFormat.getPixelStride();
    if ((pixelStride == Format.NOT_SPECIFIED) && (dataType != null) && (bitsPerPixel != Format.NOT_SPECIFIED))     pixelStride=dataType.equals(Format.byteArray) ? (bitsPerPixel / 8) : 1;
    setOutputFormat(new RGBFormat(size,Format.NOT_SPECIFIED,dataType,outputFormat.getFrameRate(),bitsPerPixel,rgbOutputFormat.getRedMask(),rgbOutputFormat.getGreenMask(),rgbOutputFormat.getBlueMask(),pixelStride,(pixelStride == Format.NOT_SPECIFIED) ? Format.NOT_SPECIFIED : (pixelStride * size.width),rgbOutputFormat.getFlipped(),rgbOutputFormat.getEndian()));
  }
 else   if (outputFormat instanceof YUVFormat) {
    YUVFormat yuvOutputFormat=(YUVFormat)outputFormat;
    setOutputFormat(new YUVFormat(size,Format.NOT_SPECIFIED,outputFormat.getDataType(),outputFormat.getFrameRate(),yuvOutputFormat.getYuvType(),Format.NOT_SPECIFIED,Format.NOT_SPECIFIED,0,Format.NOT_SPECIFIED,Format.NOT_SPECIFIED));
  }
 else   if (outputFormat != null)   logger.warn("String_Node_Str" + outputFormat.getClass().getSimpleName() + "String_Node_Str");
}