diff mbox series

[FFmpeg-devel,1/3] avformat/imf_cpl: Replace NULL content_title_utf8 by ""

Message ID 20230725004609.17750-1-michael@niedermayer.cc
State Accepted
Commit ac3e6b74bdd6959ce4411e78161b2f06d0926c43
Headers show
Series [FFmpeg-devel,1/3] avformat/imf_cpl: Replace NULL content_title_utf8 by "" | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 25, 2023, 12:46 a.m. UTC
Suggested-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/imf_cpl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Pierre-Anthony Lemieux July 25, 2023, 4:35 a.m. UTC | #1
LGTM.

On Mon, Jul 24, 2023 at 5:46 PM Michael Niedermayer
<michael@niedermayer.cc> wrote:
>
> Suggested-by: Pierre-Anthony Lemieux <pal@sandflow.com>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/imf_cpl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c
> index 69155d786d..5f1a67443f 100644
> --- a/libavformat/imf_cpl.c
> +++ b/libavformat/imf_cpl.c
> @@ -182,6 +182,10 @@ static int fill_content_title(xmlNodePtr cpl_element, FFIMFCPL *cpl)
>      cpl->content_title_utf8 = xmlNodeListGetString(cpl_element->doc,
>                                                     element->xmlChildrenNode,
>                                                     1);
> +    if (!cpl->content_title_utf8)
> +        cpl->content_title_utf8 = xmlStrdup("");
> +    if (!cpl->content_title_utf8)
> +        return AVERROR(ENOMEM);
>
>      return 0;
>  }
> --
> 2.17.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Michael Niedermayer July 25, 2023, 8:37 p.m. UTC | #2
On Mon, Jul 24, 2023 at 09:35:22PM -0700, Pierre-Anthony Lemieux wrote:
> LGTM.

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c
index 69155d786d..5f1a67443f 100644
--- a/libavformat/imf_cpl.c
+++ b/libavformat/imf_cpl.c
@@ -182,6 +182,10 @@  static int fill_content_title(xmlNodePtr cpl_element, FFIMFCPL *cpl)
     cpl->content_title_utf8 = xmlNodeListGetString(cpl_element->doc,
                                                    element->xmlChildrenNode,
                                                    1);
+    if (!cpl->content_title_utf8)
+        cpl->content_title_utf8 = xmlStrdup("");
+    if (!cpl->content_title_utf8)
+        return AVERROR(ENOMEM);
 
     return 0;
 }