Program: 103329
Project: 103329
Buggy source:
/** 
 * Creates the <tt>DataSource</tt> that this instance is to read captured media from.
 * @return the <tt>DataSource</tt> that this instance is to read capturedmedia from
 */
@Override protected DataSource createCaptureDevice(){
  DataSource captureDevice=super.createCaptureDevice();
  if (captureDevice != null) {
    MediaLocator locator=captureDevice.getLocator();
    String protocol=(locator == null) ? null : locator.getProtocol();
    float frameRate;
    DeviceConfiguration deviceConfig=NeomediaActivator.getMediaServiceImpl().getDeviceConfiguration();
    if (ImageStreamingAuto.LOCATOR_PROTOCOL.equals(protocol)) {
      frameRate=10;
    }
 else {
      Dimension videoSize=deviceConfig.getVideoSize();
      if (outputSize != null && videoSize.height > outputSize.height && videoSize.width > outputSize.width)       videoSize=outputSize;
      VideoMediaStreamImpl.selectVideoSize(captureDevice,videoSize.width,videoSize.height);
      frameRate=deviceConfig.getFrameRate();
    }
    FrameRateControl frameRateControl=(FrameRateControl)captureDevice.getControl(FrameRateControl.class.getName());
    if (frameRateControl != null) {
      float maxSupportedFrameRate=frameRateControl.getMaxSupportedFrameRate();
      if ((maxSupportedFrameRate > 0) && (frameRate > maxSupportedFrameRate))       frameRate=maxSupportedFrameRate;
      if (frameRate > 0)       frameRateControl.setFrameRate(frameRate);
    }
    if (!(captureDevice instanceof PullBufferDataSource)) {
      DataSource cloneableDataSource=Manager.createCloneableDataSource(captureDevice);
      if (cloneableDataSource != null)       captureDevice=cloneableDataSource;
    }
  }
  return captureDevice;
}

Fixed version (ground truth):
/** 
 * Creates the <tt>DataSource</tt> that this instance is to read captured media from.
 * @return the <tt>DataSource</tt> that this instance is to read capturedmedia from
 */
@Override protected DataSource createCaptureDevice(){
  DataSource captureDevice=super.createCaptureDevice();
  if (captureDevice != null) {
    MediaLocator locator=captureDevice.getLocator();
    String protocol=(locator == null) ? null : locator.getProtocol();
    float frameRate;
    DeviceConfiguration deviceConfig=NeomediaActivator.getMediaServiceImpl().getDeviceConfiguration();
    if (ImageStreamingAuto.LOCATOR_PROTOCOL.equals(protocol)) {
      frameRate=10;
    }
 else {
      Dimension videoSize=deviceConfig.getVideoSize();
      if (outputSize != null && videoSize.height > outputSize.height && videoSize.width > outputSize.width)       videoSize=outputSize;
      Dimension dim=VideoMediaStreamImpl.selectVideoSize(captureDevice,videoSize.width,videoSize.height);
      frameRate=deviceConfig.getFrameRate();
      if (logger.isInfoEnabled() && dim != null)       logger.info("String_Node_Str" + dim.width + "String_Node_Str"+ dim.height);
    }
    FrameRateControl frameRateControl=(FrameRateControl)captureDevice.getControl(FrameRateControl.class.getName());
    if (frameRateControl != null) {
      float maxSupportedFrameRate=frameRateControl.getMaxSupportedFrameRate();
      if ((maxSupportedFrameRate > 0) && (frameRate > maxSupportedFrameRate))       frameRate=maxSupportedFrameRate;
      if (frameRate > 0)       frameRateControl.setFrameRate(frameRate);
      if (logger.isInfoEnabled()) {
        logger.info("String_Node_Str" + (frameRate == -1 ? "String_Node_Str" : frameRate));
      }
    }
    if (!(captureDevice instanceof PullBufferDataSource)) {
      DataSource cloneableDataSource=Manager.createCloneableDataSource(captureDevice);
      if (cloneableDataSource != null)       captureDevice=cloneableDataSource;
    }
  }
  return captureDevice;
}