title: CVPixelBufferRef CVImageBufferRef bytesPerRow is wrong?
body: <p>so i have code that reads from an AVAsset using kCVPixelFormat_32BGRA. I get the next sample buffer by calling </p>
  
  <pre><code>[vidInput copyNextSamplebuffer];
  </code></pre>
  
  <p>Then I proceed with Apple's code on their AVFoundation guide <a href="http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/05_MediaRepresentations.html#//apple_ref/doc/uid/TP40010188-CH2-SW4" rel="nofollow">http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/05_MediaRepresentations.html#//apple_ref/doc/uid/TP40010188-CH2-SW4</a></p>
  
  <p>What troubles me is that sometimes </p>
  
  <pre><code>size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer);
  </code></pre>
  
  <p>gives me something that isnt the width*4, and as a result, when I attempt to use it, the image is teared very badly. Has anyone experienced anything similar?</p>