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-24 01:05:46 +0100
commit074ebfacf40f187069e90e1618a95926757ed7c8 (patch)
treef0667ffc7bc8487eccfd663012a1363e7857f730
parent47f8497837ebbb6877ab9d199f66f655017b769c (diff)
downloadffmpeg-074ebfacf40f187069e90e1618a95926757ed7c8.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
-rw-r--r--libavfilter/avfilter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c3228cd855..251f6ae38d 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -110,8 +110,8 @@ void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
(*count)++;
for (i = idx + 1; i < *count; i++)
- if (*links[i])
- (*(unsigned *)((uint8_t *) *links[i] + padidx_off))++;
+ if ((*links)[i])
+ (*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++;
}
int avfilter_link(AVFilterContext *src, unsigned srcpad,