title: MTK's avc decoder OMX.MTK.VIDEO.DECODER.AVC causes phone crash
body: <p>when I use MTK's avc decoder to decode video, the phone is crashed. All as I know is the frame data provided to decoder is not continuous, even not correct,  because of bad signal quality of video source.
  the log is as below:</p>
  
  <pre><code>10-14 12:15:14.187: D/BufferQueueProducer(228): [SurfaceView](this:0x7f724cc000,id:122,api:2,p:3710,c:228) cancelBuffer: slot 8
  10-14 12:15:14.187: D/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] Calling fillBuffer on buffer 0xf3031280
  10-14 12:15:14.188: E/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] +waitForBufferFilled_l: 0/2
  10-14 12:15:14.188: D/MDP(228): DpBlitStream: setPQParameter id 10000001 enable 1 scenario 1
  10-14 12:15:14.188: D/MDP(228): DpBlit: in: (720, 480, 23040, 11520, C12b, P0), crop: (0, 0, 720, 480), sec:0
  10-14 12:15:14.188: D/MDP(228): DpBlit: out: (720, 1280, 1440, 0, C5, P0), misc: (X:0, Y:0, R:270, F:0, S:1, D:0), sec:0
  **10-14 12:15:14.188: E/VDO_LOG(250): [Err] Decoding Error 0x00000010 at MC (x,y)=(44/44, 14/14)** 
  10-14 12:15:14.188: D/MtkOmxVdec(250): [0xf5102000] f5102000 FTB (0xF3031280) (0xE8975000) (518400) AVSyncTime(-1)
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] 264 DEC, 74172502100, 0x10 1261 (0xF3031520, 0xF50E0160), NAL 9 (3 ms, 3 ms), 0
  10-14 12:15:14.189: I/VDO_LOG(250): [Info] get pic info 720 480 (720 480)!!
  10-14 12:15:14.189: E/VDO_LOG(250): [DEBUG] VDEC_DRV_GET_TYPE_QUERY_VIDEO_DPB_SIZE 6
  10-14 12:15:14.189: E/VDO_LOG(250): [DEBUG] VDEC_DRV_GET_TYPE_QUERY_VIDEO_DPB_SIZE 6
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] f5102000 FBD (0xF50E0940) (0xE886F000) 74172068333 (518400) GET_DISP i(9) frm_buf(0xF5261890), flags(0x00000000)
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] f5102000 EBD (0xF3031520) (0xEA208000) (10) (10 9)
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] --AvcDecode() 
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] NalType 9
  10-14 12:15:14.189: D/MtkOmxVdec(250): [0xf5102000] @@ DecodeOneUnit frame-&gt;rBaseAddr.u4VA = 0xE8975000, frame-&gt;rBaseAddr.u4PA = 0x05E00000)
  10-14 12:15:14.189: W/VDO_LOG(250): [Warning] Multi NAL case 3 (9) 
  10-14 12:15:14.189: W/VDO_LOG(250): [Warning] Multi NAL case 3 (6) 
  10-14 12:15:14.190: W/OMXCodec(3710): FILL_BUFFER_DONE(buffer: 4111337792, size: 518400, flags: 0x00000000, timestamp: 74172068333 us (74172.07 secs))
  10-14 12:15:14.190: E/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] -waitForBufferFilled_l
  10-14 12:15:14.190: W/OMXCodec(3710): EMPTY_BUFFER_DONE(buffer: 4077065504)
  10-14 12:15:14.190: D/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] Calling emptyBuffer on buffer 0xf3031520 (length 2189), timestamp 74173152755 us (74173.15 secs)
  **10-14 12:15:14.192: E/VDO_LOG(250): [Err] Decoding Error 0x00000200 at MC (x,y)=(44/44, 14/14)** 
  10-14 12:15:14.193: D/MDP(228): DpBlit: time 4 ms, type 0
  10-14 12:15:14.219: D/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] Calling fillBuffer on buffer 0xf50e0c40
  10-14 12:15:14.219: E/OMXCodec(3710): [OMX.MTK.VIDEO.DECODER.AVC] +waitForBufferFilled_l: 0/2
  10-14 12:15:14.221: D/MDP(228): DpBlitStream: setPQParameter id 10000001 enable 1 scenario 1
  10-14 12:15:14.221: D/MDP(228): DpBlit: in: (720, 480, 23040, 11520, C12b, P0), crop: (0, 0, 720, 480), sec:0
  10-14 12:15:14.221: D/MDP(228): DpBlit: out: (720, 1280, 1440, 0, C5, P0), misc: (X:0, Y:0, R:270, F:0, S:1, D:0), sec:0
  10-14 12:15:14.226: D/MDP(228): DpBlit: time 4 ms, type 0
  : E/(): Device disconnected: 1
  : E/(): Device disconnected
  </code></pre>
  
  <p>the phone is just frozen at last picture of video, and doesn't response to any touch.
  Anyone can tell me how to stop decoder while this error happens, or how to avoid this? Thanks.</p>