H264RawSEIDisplayOrientation *disp =
&ctx->display_orientation_payload;
uint8_t *data;
- int size;
+ size_t size;
int write = 0;
data = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size);
int err, i, has_sps, seek_point;
// If an AUD is present, it must be the first NAL unit.
- if (au->units[0].type == H264_NAL_AUD) {
+ if (au->nb_units && au->units[0].type == H264_NAL_AUD) {
if (ctx->aud == BSF_ELEMENT_REMOVE)
ff_cbs_delete_unit(au, 0);
} else {
- if (ctx->aud == BSF_ELEMENT_INSERT) {
+ if (pkt && ctx->aud == BSF_ELEMENT_INSERT) {
err = h264_metadata_insert_aud(bsf, au);
if (err < 0)
return err;