summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-23 13:18:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-23 13:18:11 +0100
commit8cda755c2f510fe08b7c78d95392496535582e2f (patch)
tree2086e9fdf54063fe077cfb91ac8872e750ea35ac /libavfilter
parent0b9a69f244e399565d67100a6862886201a594a4 (diff)
downloadffmpeg-streaming-8cda755c2f510fe08b7c78d95392496535582e2f.zip
ffmpeg-streaming-8cda755c2f510fe08b7c78d95392496535582e2f.tar.gz
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>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/formats.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index b77ca8a..c626b38 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -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 */
OpenPOWER on IntegriCloud