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
1280{1280{
1281 AVFilterLink **links = graph->sink_links;1281 AVFilterLink **links = graph->sink_links;
1282 1282
1283 av_assert0(index >= 0);
1284
1283 while (index) {1285 while (index) {
1284 int parent = (index - 1) >> 1;1286 int parent = (index - 1) >> 1;
1285 if (links[parent]->current_pts >= link->current_pts)1287 if (links[parent]->current_pts >= link->current_pts)
@@ -1297,6 +1299,8 @@ static void heap_bubble_down(AVFilterGraph *graph, · 11 unmodified lines
1297{1299{
1298 AVFilterLink **links = graph->sink_links;1300 AVFilterLink **links = graph->sink_links;
1299 1301
1302 av_assert0(index >= 0);
1303
1300 while (1) {1304 while (1) {
1301 int child = 2 * index + 1;1305 int child = 2 * index + 1;
1302 if (child >= graph->sink_links_count)1306 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