diff mbox series

[FFmpeg-devel,3/5] avformat/mxfdec: Check container_ul->desc before use

Message ID 20240607003215.1723906-3-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/5] avformat/mov: Check requested_sample before using it | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 7, 2024, 12:32 a.m. UTC
Fixes: CID1592939 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mxfdec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tomas Härdin June 18, 2024, 2:31 p.m. UTC | #1
fre 2024-06-07 klockan 02:32 +0200 skrev Michael Niedermayer:
> Fixes: CID1592939 Dereference after null check
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mxfdec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index e65cec74c23..820b03940aa 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -3031,6 +3031,7 @@ static int
> mxf_parse_structural_metadata(MXFContext *mxf)
>              if (container_ul->desc)
>                  av_dict_set(&st->metadata, "data_type",
> container_ul->desc, 0);
>              if (mxf->eia608_extract &&
> +                container_ul->desc &&
>                  !strcmp(container_ul->desc, "vbi_vanc_smpte_436M"))
> {
>                  st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
>                  st->codecpar->codec_id = AV_CODEC_ID_EIA_608;

OK

/Tomas
Michael Niedermayer June 19, 2024, 11:24 a.m. UTC | #2
On Tue, Jun 18, 2024 at 04:31:49PM +0200, Tomas Härdin wrote:
> fre 2024-06-07 klockan 02:32 +0200 skrev Michael Niedermayer:
> > Fixes: CID1592939 Dereference after null check
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/mxfdec.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index e65cec74c23..820b03940aa 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -3031,6 +3031,7 @@ static int
> > mxf_parse_structural_metadata(MXFContext *mxf)
> >              if (container_ul->desc)
> >                  av_dict_set(&st->metadata, "data_type",
> > container_ul->desc, 0);
> >              if (mxf->eia608_extract &&
> > +                container_ul->desc &&
> >                  !strcmp(container_ul->desc, "vbi_vanc_smpte_436M"))
> > {
> >                  st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
> >                  st->codecpar->codec_id = AV_CODEC_ID_EIA_608;
> 
> OK

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index e65cec74c23..820b03940aa 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3031,6 +3031,7 @@  static int mxf_parse_structural_metadata(MXFContext *mxf)
             if (container_ul->desc)
                 av_dict_set(&st->metadata, "data_type", container_ul->desc, 0);
             if (mxf->eia608_extract &&
+                container_ul->desc &&
                 !strcmp(container_ul->desc, "vbi_vanc_smpte_436M")) {
                 st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
                 st->codecpar->codec_id = AV_CODEC_ID_EIA_608;