aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-17 09:59:36 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-20 07:10:17 +0100
commit02c16b48c5827b9383004ad5a727742b30614fe7 (patch)
tree89d7e14bced59833ed27ea255efa763211eab7d9
parentfbcc943b22534517670d287f35eebe40896f771f (diff)
downloadffmpeg-02c16b48c5827b9383004ad5a727742b30614fe7.tar.gz
avcodec/snow: Don't add to NULL
It is undefined behavior. Fixes "runtime error: applying non-zero offset 8 to null pointer". Fixes the Snow vsynth FATE-tests. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/snow.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index ff7ebc1c58..9b19e70bd5 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -272,7 +272,8 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer
if(!sliced && offset_dst)
dst += src_x + src_y*dst_stride;
- dst8+= src_x + src_y*src_stride;
+ if (sliced || add)
+ dst8+= src_x + src_y*src_stride;
// src += src_x + src_y*src_stride;
ptmp= tmp + 3*tmp_step;