[FFmpeg-cvslog] avfilter/ff_insert_pad: fix order of operations

Michael Niedermayer git at videolan.org
Sat Mar 8 16:48:14 CET 2014


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 21 16:21:14 2013 +0200| [2448c186768608e8f2d102d4dc8c3c931718b976] | committer: 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: Michael Niedermayer <michaelni at 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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2448c186768608e8f2d102d4dc8c3c931718b976
---

 libavfilter/avfilter.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 9f49a8b..11e880b 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -112,9 +112,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,



More information about the ffmpeg-cvslog mailing list