[FFmpeg-cvslog] Revert "avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use"

James Almer git at videolan.org
Sun Dec 1 21:59:52 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Nov 17 10:26:53 2019 -0300| [553c1431ac7dae44fb46285121bca176045fe6e7] | committer: James Almer

Revert "avcodec/cbs_av1_syntax_template: Check ref_frame_idx before use"

This reverts commit 8174e5c77d8a94b57b6b1bcbb90728cf8b08ab6b.

It's no longer needed after the previous commit.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=553c1431ac7dae44fb46285121bca176045fe6e7
---

 libavcodec/cbs_av1_syntax_template.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 796897ab79..6c4816f964 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -530,17 +530,16 @@ static int FUNC(frame_size_with_refs)(CodedBitstreamContext *ctx, RWContext *rw,
     for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
         flags(found_ref[i], 1, i);
         if (current->found_ref[i]) {
-            AV1ReferenceFrameState *ref;
+            AV1ReferenceFrameState *ref =
+                &priv->ref[current->ref_frame_idx[i]];
 
-            if (current->ref_frame_idx[i] < 0 ||
-                !priv->ref[current->ref_frame_idx[i]].valid) {
+            if (!ref->valid) {
                 av_log(ctx->log_ctx, AV_LOG_ERROR,
                        "Missing reference frame needed for frame size "
                        "(ref = %d, ref_frame_idx = %d).\n",
                        i, current->ref_frame_idx[i]);
                 return AVERROR_INVALIDDATA;
             }
-            ref = &priv->ref[current->ref_frame_idx[i]];
 
             priv->upscaled_width = ref->upscaled_width;
             priv->frame_width    = ref->frame_width;



More information about the ffmpeg-cvslog mailing list