diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2017-06-11 14:50:01 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2017-06-13 19:47:19 +0200 |
commit | 21583e936a06fa0c9dca99436c21d441d04e57f4 (patch) | |
tree | 8e30a882435b8710baf3fb36d4d0c8396c3e6c99 | |
parent | 8aa60606fb64b8280627935b0df55d4d2aeca5d1 (diff) |
avfilter/unsharp: fix uninitialized pointer read
Fixes CID 1396855
-rw-r--r-- | libavfilter/unsharp_opencl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/unsharp_opencl.c b/libavfilter/unsharp_opencl.c index d84920c590..1545455846 100644 --- a/libavfilter/unsharp_opencl.c +++ b/libavfilter/unsharp_opencl.c @@ -43,7 +43,7 @@ static int compute_mask(int step, uint32_t *mask) { int i, z, ret = 0; int counter_size = sizeof(uint32_t) * (2 * step + 1); - uint32_t *temp1_counter, *temp2_counter, **counter; + uint32_t *temp1_counter, *temp2_counter, **counter = NULL; temp1_counter = av_mallocz(counter_size); if (!temp1_counter) { ret = AVERROR(ENOMEM); @@ -80,7 +80,7 @@ static int compute_mask(int step, uint32_t *mask) end: av_freep(&temp1_counter); av_freep(&temp2_counter); - for (i = 0; i < 2 * step + 1; i++) { + for (i = 0; counter && i < 2 * step + 1; i++) { av_freep(&counter[i]); } av_freep(&counter); |