[FFmpeg-devel] [PATCH 2/3] avformat/dashdec: check return code of avcodec_parameters_copy()

Steven Liu lingjiujianke at gmail.com
Sat Oct 12 04:22:41 EEST 2024


Marth64 <marth64 at proxyid.net> 于2024年10月11日周五 15:13写道:
>
> Signed-off-by: Marth64 <marth64 at proxyid.net>
> ---
>  libavformat/dashdec.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 9ce23aec65..cd1b3da3a2 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -1949,7 +1949,11 @@ static int open_demux_for_component(AVFormatContext *s, struct representation *p
>              return AVERROR(ENOMEM);
>
>          st->id = i;
> -        avcodec_parameters_copy(st->codecpar, ist->codecpar);
> +
> +        ret = avcodec_parameters_copy(st->codecpar, ist->codecpar);
> +        if (ret < 0)
> +            return ret;
> +
>          avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
>
>          // copy disposition
> --
> 2.34.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

lgtm

Thanks
Steven


More information about the ffmpeg-devel mailing list