History

avfilter/avfiltergraph: assert that the heap_bubble index is valid

This might help coverity

Michael Niedermayer committed 11 years ago

Commit a76e91b1 parent 424ed1a1 file · +4 −0Browse files

Unified · Split

libavfilter/avfiltergraph.c+4−0
@@ -1280,6 +1280,8 @@ static void heap_bubble_up(AVFilterGraph *graph, · 1279 unmodified lines
12801280 {
12811281 AVFilterLink **links = graph->sink_links;
12821282
1283+ av_assert0(index >= 0);
1284+
12831285 while (index) {
12841286 int parent = (index - 1) >> 1;
12851287 if (links[parent]->current_pts >= link->current_pts)
@@ -1297,6 +1299,8 @@ static void heap_bubble_down(AVFilterGraph *graph, · 11 unmodified lines
12971299 {
12981300 AVFilterLink **links = graph->sink_links;
12991301
1302+ av_assert0(index >= 0);
1303+
13001304 while (1) {
13011305 int child = 2 * index + 1;
13021306 if (child >= graph->sink_links_count)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t