[FFmpeg-cvslog] avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointer

James Almer git at videolan.org
Sun Jun 22 23:51:01 EEST 2025


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Jun 22 10:51:06 2025 -0300| [b1172b8cc615a884d4051517d7356d5842939bb6] | committer: James Almer

avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointer

Fixes: libavcodec/mss2dsp.c:59:14: runtime error: applying zero offset to null pointer

Tested-by: Kacper Michajlow <kasper93 at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/mss2dsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index cc39dd637f..ace92ef9c7 100644
--- a/libavcodec/mss2dsp.c
+++ b/libavcodec/mss2dsp.c
@@ -56,7 +56,7 @@ static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
                 }
             }
         }
-        mask +=  mask_stride;
+        mask  = FF_PTR_ADD(mask, mask_stride);
         dst  +=   dst_stride;
         srcy +=  srcy_stride;
         srcu += srcuv_stride * (r & 1);



More information about the ffmpeg-cvslog mailing list