On 06/26/2012 07:53 AM, Anton Khirnov wrote:
> ---
>  libavfilter/avfiltergraph.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index b9f0164..c147c3b 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -29,6 +29,7 @@
>  #include "internal.h"
>  
>  #include "libavutil/audioconvert.h"
> +#include "libavutil/avassert.h"
>  #include "libavutil/log.h"
>  
>  static const AVClass filtergraph_class = {
> @@ -497,7 +498,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext 
> *filter)
>  
>      for (i = 0; i < filter->nb_outputs; i++) {
>          AVFilterLink *outlink = filter->outputs[i];
> -        int best_idx, best_score = INT_MIN;
> +        int best_idx = -1, best_score = INT_MIN;
>  
>          if (outlink->type != AVMEDIA_TYPE_AUDIO ||
>              outlink->in_formats->format_count < 2)
> @@ -530,6 +531,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext 
> *filter)
>                  best_idx   = j;
>              }
>          }
> +        av_assert0(best_idx >= 0);
>          FFSWAP(int, outlink->in_formats->formats[0],
>                 outlink->in_formats->formats[best_idx]);
>      }

LGTM. again, please state the full warning in the commit message.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to