aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-10-11 20:42:58 -0700
committerAman Gupta <aman@tmm1.net>2018-10-16 11:54:42 -0700
commit70d0d83d4d61f4c85ff4fe75e24de94a27f61288 (patch)
tree24ab256656635eaed8f31236b10c25d9701e4eee
parentaec3daa8b4b31235b61922642df06f0f26fef082 (diff)
downloadffmpeg-70d0d83d4d61f4c85ff4fe75e24de94a27f61288.tar.gz
avcodec/cbs: fix crash in sei_pic_timestamp
Signed-off-by: Aman Gupta <aman@tmm1.net> (cherry picked from commit b6c3a02740871f4992ab7c34a95dfa53a56ba382)
-rw-r--r--libavcodec/cbs_h264_syntax_template.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index b5cd0b2310..834b44a091 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -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)