diff mbox series

[FFmpeg-devel,1/1] bug: test pointer to be used.

Message ID 20210104181101.62248-2-alexis@m2osw.com
State Accepted
Commit ca21cb1e36ccae2ee71d4299d477fa9284c1f551
Headers show
Series bug: test pointer to be used.
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

AlexisWilke Jan. 4, 2021, 6:11 p.m. UTC
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.
---
 libavformat/allformats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer Jan. 12, 2021, 3:20 a.m. UTC | #1
On 1/4/2021 3:11 PM, AlexisWilke wrote:
> 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.
> ---
>   libavformat/allformats.c | 4 ++--
>   1 file 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];
>       }

Applied. Thanks.
diff mbox series

Patch

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];
     }