1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/avfiltergraph: assert that the heap_bubble index is valid

This might help coverity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-18 11:55:44 +01:00
parent 424ed1a83e
commit a76e91bf67

View File

@ -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)