Browse Source

avfilter: dont write out of array for duplicate formats in avfilter_merge_formats()

Note, this is a theoretical fix, iam not aware of a case where this function receives
duplicates in its input.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.9
Michael Niedermayer 14 years ago
parent
commit
8cda755c2f
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavfilter/formats.c

+ 3
- 1
libavfilter/formats.c View File

@@ -56,8 +56,10 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
b->format_count));
for (i = 0; i < a->format_count; i++)
for (j = 0; j < b->format_count; j++)
if (a->formats[i] == b->formats[j])
if (a->formats[i] == b->formats[j]){
ret->formats[k++] = a->formats[i];
break;
}

ret->format_count = k;
/* check that there was at least one common format */


Loading…
Cancel
Save