diff mbox

[FFmpeg-devel] Fix crash in join filter

Message ID 20180202231104.195565-1-nbowe@google.com
State Accepted
Commit c86490c49a3d0683b2f63338430a369c174e2bd5
Headers show

Commit Message

Niki Bowe Feb. 2, 2018, 11:11 p.m. UTC
Previously if ff_outlink_frame_wanted() returned 0 it could dereference a null pointer when trying to read nb_samples.
---
 libavfilter/af_join.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paul B Mahol Feb. 3, 2018, 9:13 a.m. UTC | #1
On 2/3/18, Nikolas Bowe <nbowe-at-google.com@ffmpeg.org> wrote:
> Previously if ff_outlink_frame_wanted() returned 0 it could dereference a
> null pointer when trying to read nb_samples.
> ---
>  libavfilter/af_join.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
> index cf5131e8dc..4f86e13558 100644
> --- a/libavfilter/af_join.c
> +++ b/libavfilter/af_join.c
> @@ -485,6 +485,9 @@ static int activate(AVFilterContext *ctx)
>                  return 0;
>              }
>          }
> +        if (!s->input_frames[0]) {
> +            return 0;
> +        }
>      }
>
>      nb_samples = s->input_frames[0]->nb_samples;
> --
> 2.16.0.rc1.238.g530d649a79-goog
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

lgtm
Michael Niedermayer Feb. 3, 2018, 6:14 p.m. UTC | #2
On Sat, Feb 03, 2018 at 10:13:28AM +0100, Paul B Mahol wrote:
> On 2/3/18, Nikolas Bowe <nbowe-at-google.com@ffmpeg.org> wrote:
> > Previously if ff_outlink_frame_wanted() returned 0 it could dereference a
> > null pointer when trying to read nb_samples.
> > ---
> >  libavfilter/af_join.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
> > index cf5131e8dc..4f86e13558 100644
> > --- a/libavfilter/af_join.c
> > +++ b/libavfilter/af_join.c
> > @@ -485,6 +485,9 @@ static int activate(AVFilterContext *ctx)
> >                  return 0;
> >              }
> >          }
> > +        if (!s->input_frames[0]) {
> > +            return 0;
> > +        }
> >      }
> >
> >      nb_samples = s->input_frames[0]->nb_samples;
> > --
> > 2.16.0.rc1.238.g530d649a79-goog
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> lgtm

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index cf5131e8dc..4f86e13558 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -485,6 +485,9 @@  static int activate(AVFilterContext *ctx)
                 return 0;
             }
         }
+        if (!s->input_frames[0]) {
+            return 0;
+        }
     }
 
     nb_samples = s->input_frames[0]->nb_samples;