diff mbox series

[FFmpeg-devel,01/10] ffmpeg: reset the dict iterator before use

Message ID 20210808172941.18238-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/10] ffmpeg: reset the dict iterator before use
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

Anton Khirnov Aug. 8, 2021, 5:29 p.m. UTC
---
 fftools/ffmpeg_filter.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Almer Aug. 8, 2021, 10:39 p.m. UTC | #1
On 8/8/2021 2:29 PM, Anton Khirnov wrote:
> ---
>   fftools/ffmpeg_filter.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index 49076f13ee..b252ee4138 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -971,6 +971,7 @@ int configure_filtergraph(FilterGraph *fg)
>           fg->graph->nb_threads = filter_nbthreads;
>   
>           args[0] = 0;
> +        e       = NULL;
>           while ((e = av_dict_get(ost->sws_dict, "", e,

This is the first use of e, so it's already NULL. Did you meant to reset 
it for the fg->outputs[0]->ost->resample_opts loop several lines below?

>                                   AV_DICT_IGNORE_SUFFIX))) {
>               av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
> @@ -984,6 +985,7 @@ int configure_filtergraph(FilterGraph *fg)
>           }
>   
>           args[0] = 0;
> +        e       = NULL;
>           while ((e = av_dict_get(ost->swr_opts, "", e,
>                                   AV_DICT_IGNORE_SUFFIX))) {
>               av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
>
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 49076f13ee..b252ee4138 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -971,6 +971,7 @@  int configure_filtergraph(FilterGraph *fg)
         fg->graph->nb_threads = filter_nbthreads;
 
         args[0] = 0;
+        e       = NULL;
         while ((e = av_dict_get(ost->sws_dict, "", e,
                                 AV_DICT_IGNORE_SUFFIX))) {
             av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
@@ -984,6 +985,7 @@  int configure_filtergraph(FilterGraph *fg)
         }
 
         args[0] = 0;
+        e       = NULL;
         while ((e = av_dict_get(ost->swr_opts, "", e,
                                 AV_DICT_IGNORE_SUFFIX))) {
             av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);