title: Error while decoding camera stream video frame using FFMpeg iOS
body: <p>I have an app, In which I am decoding video frames coming from ip camera, but the method <code>avcodec_decode_video2(m_pCodecCtx, m_pFrame, &amp;consumed_bytes, &amp;avpkt);</code> present in <code>avcodec.h</code> generating bad_access, I can't figure out what is wrong.</p>
  
  <p>This app was working fine with old libraries FFMpeg, but by apple policy, in order to publish app it support arm64, so I updated my libraries to support arm64 and after that this issue occurred.</p>
  
  <p><strong>Here is the screenshot</strong></p>
  
  <p><a href="https://i.stack.imgur.com/vIdiN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vIdiN.png" alt="enter image description here"></a></p>
  
  <p><strong>While bad_access app is generating the following log:</strong></p>
  
  <pre><code>[h264 @ 0x1071400] sps_id 12 out of range
  [h264 @ 0x1071400] pps_id 417 out of range
  [h264 @ 0x1071400] sps_id 3 out of range
  [h264 @ 0x1071400] sps_id 32 out of range
  [h264 @ 0x1071400] sps_id 6 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 32 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 3 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 32 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 32 out of range
  [h264 @ 0x1071400] sps_id 3 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] pps_id 418 out of range
  [h264 @ 0x1071400] Partitioned H.264 support is incomplete
  [h264 @ 0x1071400] sps_id 6 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 1 out of range
  [h264 @ 0x1071400] non-existing PPS 3 referenced
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] slice type 10 too large at 0 0
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] non-existing PPS 2 referenced
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] slice type 29 too large at 0 0
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] sps_id 2 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] sps_id 0 out of range
  [h264 @ 0x1071400] slice type 32 too large at 0 0
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] slice type 32 too large at 0 0
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] slice type 32 too large at 0 0
  [h264 @ 0x1071400] decode_slice_header error
  [h264 @ 0x1071400] slice type 32 too large at 0 0
  </code></pre>
  
  <p><strong>Complete error log :</strong> <a href="https://drive.google.com/file/d/0B-Nh7ci6wLX0OVlxaXV4aGpJems/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/0B-Nh7ci6wLX0OVlxaXV4aGpJems/view?usp=sharing</a></p>
  
  <p><strong>Crash Log :</strong> <a href="http://crashes.to/s/6765d63b540" rel="nofollow noreferrer">http://crashes.to/s/6765d63b540</a></p>
  
  <p>Note: If you need any thing else, please comment.</p>