Draw FBO inside other FBO, scaling issue

I’ve been having a problem with FBO’s someone might be familiar with. I’m working in the 007 prerelease found on the downloads page. I use this code to allocate 2 fbo’s and fill them with red and green:

  
  
    ofFbo::Settings settings;    
    settings.width = ofGetWidth();    
    settings.height = ofGetHeight();    
    settings.internalformat = GL_RGBA;    
    settings.numSamples = 0;    
    settings.useDepth = false;    
    settings.useStencil = false;  
    fbo1.allocate(settings);  
    fbo2.allocate(settings);  
      
    fbo1.begin();  
    ofClear(255, 0, 0);  
    fbo1.end();  
      
    fbo2.begin();  
    ofClear(0, 255, 0);  
    fbo2.end()  
  

Next, I draw fbo2 inside fbo1 and draw fbo1 to screen:

  
  
    fbo1.begin();  
    fbo2.draw(0,0,ofGetWidth(),ofGetHeight());  
    fbo1.end();  
      
    fbo1.draw(0,0);  
  

I expect to see a green screen, but fbo2 is not filling the screen. See my attachments for the result. This happens in the simulator, but also on the device. On iPhone the width and height are wrong, while on iPad only the width seems to be off. This code works fine on osx. What am I doing wrong?

Thanks,
Daan

To answer my own question, I had to use power-of-two dimensions for the FBO’s.