Browse Source

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>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
ab2bfb85d4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavfilter/avfilter.c

+ 2
- 2
libavfilter/avfilter.c View File

@@ -119,8 +119,8 @@ int 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))++;

return 0;
}


Loading…
Cancel
Save