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

Michael Niedermayer git at videolan.org
Mon Oct 21 16:50:39 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 21 16:21:14 2013 +0200| [ab2bfb85d49b2f8aa505816f93e75fd18ad0a361] | 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>

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

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

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7ce82f8..f31968f 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list