[FFmpeg-cvslog] av1dec: Don't crash if decoding of some frames have failed
Martin Storsjö
git at videolan.org
Fri Oct 4 23:02:09 EEST 2024
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Sep 25 15:04:57 2024 +0300| [a27f3c590f08bdc91e26ba39f9ea4adc1bbe79a5] | committer: Martin Storsjö
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 at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a27f3c590f08bdc91e26ba39f9ea4adc1bbe79a5
---
libavcodec/av1dec.c | 2 ++
1 file changed, 2 insertions(+)
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) {
More information about the ffmpeg-cvslog
mailing list