[FFmpeg-devel] [PATCH 10/17] avformat/mxfdec: Simplify data->hex string conversion
Tomas Härdin
tjoppen at acc.umu.se
Tue Nov 9 23:29:04 EET 2021
tis 2021-11-09 klockan 19:01 +0100 skrev Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
> libavformat/mxfdec.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index af9d33f796..4191e82474 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1984,22 +1984,15 @@ static int mxf_uid_to_str(UID uid, char
> **str)
>
> static int mxf_umid_to_str(UID ul, UID uid, char **str)
> {
> - int i;
> char *p;
> p = *str = av_mallocz(sizeof(UID) * 4 + 2 + 1);
> if (!p)
> return AVERROR(ENOMEM);
> snprintf(p, 2 + 1, "0x");
Could use strncpy() while you're at it.
/Tomas
More information about the ffmpeg-devel
mailing list