Skip to content

Commit

Permalink
avcodec/cbs: fix crash in sei_pic_timestamp
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Gupta <aman@tmm1.net>
(cherry picked from commit b6c3a02)
  • Loading branch information
tmm1 committed Oct 16, 2018
1 parent aec3daa commit 70d0d83
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libavcodec/cbs_h264_syntax_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,12 @@ static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
}

sps = h264->active_sps;
if (!sps) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"No active SPS for pic_timestamp.\n");
return AVERROR_INVALIDDATA;
}

if (sps->vui.nal_hrd_parameters_present_flag)
time_offset_length = sps->vui.nal_hrd_parameters.time_offset_length;
else if (sps->vui.vcl_hrd_parameters_present_flag)
Expand Down

0 comments on commit 70d0d83

Please sign in to comment.