[FFmpeg-cvslog] avfilter/opencl: Fix program_opencl for source code larger than 64kB

Tsutomu Seki git at videolan.org
Sat Oct 16 13:17:27 EEST 2021


ffmpeg | branch: master | Tsutomu Seki <sekiriki at gmail.com> | Thu May  6 14:13:15 2021 +0900| [9b445663a544b777f1470692a9fa64f2d481efa4] | committer: Paul B Mahol

avfilter/opencl: Fix program_opencl for source code larger than 64kB

The condition (pos < len) is always true and the
rest of the OpenCL program code would not be read, while
the maximum number of "rb" is "len - pos - 1", and then, the
maximum number of the "pos" is "len - 1".

Fixes: trac.ffmpeg.org/ticket/9217

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

 libavfilter/opencl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/opencl.c b/libavfilter/opencl.c
index 8174537c2b..70d5edb78c 100644
--- a/libavfilter/opencl.c
+++ b/libavfilter/opencl.c
@@ -242,7 +242,7 @@ int ff_opencl_filter_load_program_from_file(AVFilterContext *avctx,
             goto fail;
         }
         pos += rb;
-        if (pos < len)
+        if (pos + 1 < len)
             break;
         len <<= 1;
         err = av_reallocp(&src, len);



More information about the ffmpeg-cvslog mailing list