summaryrefslogtreecommitdiff
path: root/libavcodec/h264_refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264_refs.c')
-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 af70829594..976044ce2c 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -614,6 +614,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;
@@ -817,6 +823,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
h->frame_recovered |= FRAME_RECOVERED_SEI;
}
+out:
return (h->avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
}