Commit ab2bfb85 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c6552169
...@@ -119,8 +119,8 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, ...@@ -119,8 +119,8 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
(*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))++;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment