aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-09-25 15:04:57 +0300
committerMartin Storsjö <martin@martin.st>2024-10-04 22:57:03 +0300
commita27f3c590f08bdc91e26ba39f9ea4adc1bbe79a5 (patch)
treed1d02a1a1f9d690221e89e39fe6997d1b097ca74
parent846fbc395be77ebc76b578ee74d424d2e44a4e96 (diff)
downloadffmpeg-a27f3c590f08bdc91e26ba39f9ea4adc1bbe79a5.tar.gz
av1dec: Don't crash if decoding of some frames have failed
If decoding with hwaccel, but decoding fails, these pointers are null at this point. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavcodec/av1dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 6a9de07d16..bc4ef63e68 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -281,6 +281,8 @@ static void skip_mode_params(AV1DecContext *s)
forward_idx = -1;
backward_idx = -1;
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
+ if (!s->ref[header->ref_frame_idx[i]].raw_frame_header)
+ return;
ref_hint = s->ref[header->ref_frame_idx[i]].raw_frame_header->order_hint;
dist = get_relative_dist(seq, ref_hint, header->order_hint);
if (dist < 0) {