decoder_inspect: consume trailing zero bytes
this matches decoder_decode() and fixes decode errors in the analyzer
Change-Id: Ie6bbfa18163c1eb0c9218402d973fe7a862a92c6
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index 0de272a..38c1dfa 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -582,6 +582,7 @@
void *user_priv) {
aom_codec_err_t res = AOM_CODEC_OK;
+ const uint8_t *const data_end = data + data_sz;
Av1DecodeReturn *data2 = (Av1DecodeReturn *)user_priv;
if (ctx->frame_workers == NULL) {
@@ -600,6 +601,13 @@
if (ctx->frame_workers->had_error)
return update_error_state(ctx, &frame_worker_data->pbi->common.error);
+ // Allow extra zero bytes after the frame end
+ while (data < data_end) {
+ const uint8_t marker = data[0];
+ if (marker) break;
+ ++data;
+ }
+
data2->idx = -1;
for (int i = 0; i < REF_FRAMES; ++i)
if (cm->ref_frame_map[i] == cm->cur_frame) data2->idx = i;