aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McGovern <gseanmcg@gmail.com>2017-05-07 17:11:59 -0400
committerSean McGovern <gseanmcg@gmail.com>2017-05-09 17:28:36 -0400
commitcb167f2947f1a2c446bd8db196d0e64ef4a6d06b (patch)
tree3bb839a55bf76e759680be0c2452fa42041328ab
parentcfd25488bf35123bdd38ecbe1107a21df2e03c2f (diff)
downloadffmpeg-cb167f2947f1a2c446bd8db196d0e64ef4a6d06b.tar.gz
h264_refs: validate the SPS pointer in ff_h264_execute_ref_pic_marking()
Bug-Id: 1036 CC: libav-stable@libav.org
-rw-r--r--libavcodec/h264_refs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index b4dc49cc41..9536c4beaa 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -557,6 +557,12 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
int current_ref_assigned = 0, err = 0;
H264Picture *av_uninit(pic);
+ if (!h->ps.sps) {
+ av_log(h->avctx, AV_LOG_ERROR, "SPS is unset\n");
+ err = AVERROR_INVALIDDATA;
+ goto out;
+ }
+
if (!h->explicit_ref_marking)
generate_sliding_window_mmcos(h);
mmco_count = h->nb_mmco;
@@ -725,6 +731,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
print_short_term(h);
print_long_term(h);
+out:
return (h->avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
}