uint32_t sps_size=0, pps_size=0;
uint8_t *sps=0, *pps=0;
- avc_parse_nal_units(&track->vosData, &track->vosLen);
+ int ret = avc_parse_nal_units(&track->vosData, &track->vosLen);
+ if (ret < 0)
+ return ret;
buf = track->vosData;
end = track->vosData + track->vosLen;
if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) {
/* from x264 or from bytestream h264 */
/* nal reformating needed */
- avc_parse_nal_units(&pkt->data, &pkt->size);
+ int ret = avc_parse_nal_units(&pkt->data, &pkt->size);
+ if (ret < 0)
+ return ret;
assert(pkt->size);
size = pkt->size;
} else if (enc->codec_id == CODEC_ID_DNXHD && !trk->vosLen) {