summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexisWilke <alexis@m2osw.com>2021-01-04 10:11:01 -0800
committerJames Almer <jamrial@gmail.com>2021-01-12 00:17:30 -0300
commitca21cb1e36ccae2ee71d4299d477fa9284c1f551 (patch)
treebf7292107b7fccd864cba2e2e6e92188fdde5839
parent88519be8db66811e203408b413d9039ac9c3fe91 (diff)
avformat/allformats: test pointer to be used
Two tests check the opposite pointer before using it. If only one of these is set to a valid pointer, one of these functions will crash, the other will ignore the pointer. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/allformats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0e0caaad39..6990af55f4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -541,7 +541,7 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
if (i < size) {
f = muxer_list[i];
- } else if (indev_list) {
+ } else if (outdev_list) {
f = outdev_list[i - size];
}
@@ -558,7 +558,7 @@ const AVInputFormat *av_demuxer_iterate(void **opaque)
if (i < size) {
f = demuxer_list[i];
- } else if (outdev_list) {
+ } else if (indev_list) {
f = indev_list[i - size];
}