IF a media file reported a nal size length not
equals to 3/4. It will asserts.
Change it to report error on that media instead
of asserts.
FEIJ-335
Change-Id: Id46a423102407388eff2b7f3b069cb7c4354df32
//copy data
if ((mIsAVC || mIsHEVC) && mNal2AnnexB) {
/* This only works for NAL sizes 3-4 */
- CHECK(mNALLengthSize == 3 || mNALLengthSize == 4);
+ if ((mNALLengthSize != 3) && (mNALLengthSize != 4)) {
+ ALOGE("cannot use convertNal2AnnexB, nal size: %d", mNALLengthSize);
+ mediaBuffer->release();
+ mediaBuffer = NULL;
+ av_packet_unref(&pkt);
+ return ERROR_MALFORMED;
+ }
uint8_t *dst = (uint8_t *)mediaBuffer->data();
/* Convert H.264 NAL format to annex b */