[FFmpeg-devel] [PATCH 21/60] fftools/ffmpeg_mux_init: fix variable shadowing

Anton Khirnov anton at khirnov.net
Fri Sep 13 13:00:33 EEST 2024


Quoting Marvin Scholz (2024-09-08 22:21:03)
> ---
>  fftools/ffmpeg_mux_init.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
> index 8d475f5b45..c2867192ee 100644
> --- a/fftools/ffmpeg_mux_init.c
> +++ b/fftools/ffmpeg_mux_init.c
> @@ -661,11 +661,9 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o,
>          }
>          opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix);
>          if (chroma_intra_matrix) {
> -            uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64);
> -            if (!p)
> +            if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64)))

I heavily dislike assignments inside if().

Otherwise looks ok

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list