[FFmpeg-devel] [PATCH v2 2/2] avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointer
Kacper Michajlow
kasper93 at gmail.com
Sun Jun 22 17:57:42 EEST 2025
On Sun, 22 Jun 2025 at 15:54, James Almer
<jamrial-at-gmail.com at ffmpeg.org> wrote:
>
> Fixes: libavcodec/mss2dsp.c:59:14: runtime error: applying zero offset to null pointer
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> Untested, as gcc-usan on Linux x86_64 doesn't complain about it, but it can be seen in
> https://fate.ffmpeg.org/report.cgi?time=20250622122557&slot=amd64-clang-cl-msvc-asan
>
> 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);
I can confirm this fixes the mss2-region test. Though I didn't check
the code if similar to other example wouldn't "non-zero offset"
warning come up. At least the test passes. Thanks.
- Kacper
More information about the ffmpeg-devel
mailing list