This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/9.1 in repository ffmpeg.
commit 663351c3b6e5c6366b22e6c2076aa22340683a4d Author: Martin Mirchev <[email protected]> AuthorDate: Wed Oct 21 18:24:22 2026 +0800 Commit: Michael Niedermayer <[email protected]> CommitDate: Thu Nov 19 14:56:30 2026 +0100 avfilter/vf_curves: unmap the psfile with the mapped pointer and size parse_psfile() advances buf and decrements size while reading the file, and then passed these to av_file_unmap() instead of what av_file_map() returned. With mmap, munmap() then fails with EINVAL because the pointer is no longer page aligned, so the mapping leaks on every init and every psfile command; on builds without mmap, av_free() is called on a pointer into the middle of the buffer. Keep the mapped pointer and size and unmap those. Signed-off-by: Martin Mirchev <[email protected]> (cherry picked from commit cc30be196d7d081ca07464fc7df6d0ebb6a93bc4) Signed-off-by: Michael Niedermayer <[email protected]> --- libavfilter/vf_curves.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c index 5fc8625a1c..717ef08cdc 100644 --- a/libavfilter/vf_curves.c +++ b/libavfilter/vf_curves.c @@ -586,17 +586,19 @@ end: static int parse_psfile(AVFilterContext *ctx, const char *fname) { CurvesContext *curves = ctx->priv; - uint8_t *buf; - size_t size; + uint8_t *map, *buf; + size_t map_size, size; int i, ret, version av_unused, nb_curves; AVBPrint ptstr; static const int comp_ids[] = {3, 0, 1, 2}; av_bprint_init(&ptstr, 0, AV_BPRINT_SIZE_AUTOMATIC); - ret = av_file_map(fname, &buf, &size, 0, NULL); + ret = av_file_map(fname, &map, &map_size, 0, NULL); if (ret < 0) return ret; + buf = map; + size = map_size; #define READ16(dst) do { \ if (size < 2) { \ @@ -635,7 +637,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname) } end: av_bprint_finalize(&ptstr, NULL); - av_file_unmap(buf, size); + av_file_unmap(map, map_size); return ret; } -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
