aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTsutomu Seki <sekiriki@gmail.com>2021-05-06 14:13:15 +0900
committerPaul B Mahol <onemda@gmail.com>2021-10-16 12:17:23 +0200
commit9b445663a544b777f1470692a9fa64f2d481efa4 (patch)
tree1e28b53472e3acf97573a31fed8d4e3287d04cd7
parent5bcc61ce87922ecccaaa0bd303a7e195929859a8 (diff)
downloadffmpeg-9b445663a544b777f1470692a9fa64f2d481efa4.tar.gz
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
-rw-r--r--libavfilter/opencl.c2
1 files changed, 1 insertions, 1 deletions
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);