[FFmpeg-cvslog] avfilter/avfiltergraph: assert that the heap_bubble index is valid

Michael Niedermayer git at videolan.org
Wed Feb 18 12:46:28 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 18 11:55:44 2015 +0100| [a76e91bf6708f8a4d17a69b157c4a860ccdcda95] | committer: Michael Niedermayer

avfilter/avfiltergraph: assert that the heap_bubble index is valid

This might help coverity

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/avfiltergraph.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index a859ecb..2e69cdd 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -1280,6 +1280,8 @@ static void heap_bubble_up(AVFilterGraph *graph,
 {
     AVFilterLink **links = graph->sink_links;
 
+    av_assert0(index >= 0);
+
     while (index) {
         int parent = (index - 1) >> 1;
         if (links[parent]->current_pts >= link->current_pts)
@@ -1297,6 +1299,8 @@ static void heap_bubble_down(AVFilterGraph *graph,
 {
     AVFilterLink **links = graph->sink_links;
 
+    av_assert0(index >= 0);
+
     while (1) {
         int child = 2 * index + 1;
         if (child >= graph->sink_links_count)



More information about the ffmpeg-cvslog mailing list