Ensure new sequence not start with a show_existing frame
This commit adds a check to return error when a new coded video sequence
starts with a frame having show_existing_frame equal true.
Change-Id: Ifd61d5c4d7a61babda1819160216d4033ca4e9cb
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 385c2c3..0a50328 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -4434,6 +4434,11 @@
cm->reset_decoder_state = 0;
if (cm->show_existing_frame) {
+ if (pbi->sequence_header_changed) {
+ aom_internal_error(
+ &cm->error, AOM_CODEC_CORRUPT_FRAME,
+ "New sequence header starts with a show_existing_frame.");
+ }
// Show an existing frame directly.
const int existing_frame_idx = aom_rb_read_literal(rb, 3);
const int frame_to_show = cm->ref_frame_map[existing_frame_idx];