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 ab2bfb85d4
)
Conflicts:
libavfilter/avfilter.c
(cherry picked from commit 86591b244f3a27293153896813f5569b49b2f5c0)
Conflicts:
libavfilter/avfilter.c
This commit is contained in:
@ -117,9 +117,9 @@ void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
|
|||||||
(*links)[idx] = NULL;
|
(*links)[idx] = NULL;
|
||||||
|
|
||||||
(*count)++;
|
(*count)++;
|
||||||
for (i = idx+1; i < *count; i++)
|
for (i = idx + 1; i < *count; i++)
|
||||||
if (*links[i])
|
if ((*links)[i])
|
||||||
(*(unsigned *)((uint8_t *) *links[i] + padidx_off))++;
|
(*(unsigned *)((uint8_t *) (*links)[i] + padidx_off))++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int avfilter_link(AVFilterContext *src, unsigned srcpad,
|
int avfilter_link(AVFilterContext *src, unsigned srcpad,
|
||||||
|
Reference in New Issue
Block a user