aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-21 16:21:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-12-21 01:45:20 +0100
commit5bd291e265b988c285f96076b6d9f05de940439b (patch)
tree40172a2f2297c81fbdc7f9fb6ae741519474a620
parentb8eaf47917ab921d4f36cf04bc43af4ef5d30b37 (diff)
downloadffmpeg-5bd291e265b988c285f96076b6d9f05de940439b.tar.gz
avfilter/ff_insert_pad: fix order of operations
Fixes out of bounds access Fixes CID732170 Fixes CID732169 No filter is known to use this function in a way so the issue can be reproduced. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit ab2bfb85d49b2f8aa505816f93e75fd18ad0a361) Conflicts: libavfilter/avfilter.c (cherry picked from commit 86591b244f3a27293153896813f5569b49b2f5c0) Conflicts: libavfilter/avfilter.c (cherry picked from commit 400c4f8fa3fd58951dc3f356b2b00484e3363694) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/avfilter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 4edd5be30f..b21e1ad07f 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -117,9 +117,9 @@ void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
(*links)[idx] = NULL;
(*count)++;
- for (i = idx+1; i < *count; i++)
- if (*links[i])
- (*(unsigned *)((uint8_t *) *links[i] + padidx_off))++;
+ for (i = idx + 1; i < *count; i++)
+ if ((*links)[i])
+ (*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++;
}
int avfilter_link(AVFilterContext *src, unsigned srcpad,