diff mbox

[FFmpeg-devel,6/8] avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample

Message ID 20180627181121.30735-6-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer June 27, 2018, 6:11 p.m. UTC
Fixes: out of array read
Fixes: ffmpeg_crash_8.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/movenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer June 27, 2018, 6:54 p.m. UTC | #1
On 6/27/2018 3:11 PM, Michael Niedermayer wrote:
> Fixes: out of array read
> Fixes: ffmpeg_crash_8.avi
> 
> Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/movenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 00567db586..2603b9c95f 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -429,7 +429,7 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
>  
>              if (hdr->substreamid == info->num_ind_sub + 1) {
>                  //info->num_ind_sub++;
> -                avpriv_request_sample(track->par, "Multiple independent substreams");
> +                avpriv_request_sample(mov, "Multiple independent substreams");

mov->fc

>                  ret = AVERROR_PATCHWELCOME;
>                  goto end;
>              } else if (hdr->substreamid < info->num_ind_sub ||
> @@ -439,7 +439,7 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
>              }
>          } else {
>              if (hdr->substreamid != 0) {
> -                avpriv_request_sample(track->par, "Multiple dependent substreams");
> +                avpriv_request_sample(mov, "Multiple dependent substreams");

Same.

>                  ret = AVERROR_PATCHWELCOME;
>                  goto end;
>              }
>
Michael Niedermayer June 27, 2018, 9:40 p.m. UTC | #2
On Wed, Jun 27, 2018 at 03:54:06PM -0300, James Almer wrote:
> On 6/27/2018 3:11 PM, Michael Niedermayer wrote:
> > Fixes: out of array read
> > Fixes: ffmpeg_crash_8.avi
> > 
> > Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/movenc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> > index 00567db586..2603b9c95f 100644
> > --- a/libavformat/movenc.c
> > +++ b/libavformat/movenc.c
> > @@ -429,7 +429,7 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
> >  
> >              if (hdr->substreamid == info->num_ind_sub + 1) {
> >                  //info->num_ind_sub++;
> > -                avpriv_request_sample(track->par, "Multiple independent substreams");
> > +                avpriv_request_sample(mov, "Multiple independent substreams");
> 
> mov->fc
> 
> >                  ret = AVERROR_PATCHWELCOME;
> >                  goto end;
> >              } else if (hdr->substreamid < info->num_ind_sub ||
> > @@ -439,7 +439,7 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
> >              }
> >          } else {
> >              if (hdr->substreamid != 0) {
> > -                avpriv_request_sample(track->par, "Multiple dependent substreams");
> > +                avpriv_request_sample(mov, "Multiple dependent substreams");
> 
> Same.

will change it but this function used mov before. ill change that too

thx


[...]
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 00567db586..2603b9c95f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -429,7 +429,7 @@  static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
 
             if (hdr->substreamid == info->num_ind_sub + 1) {
                 //info->num_ind_sub++;
-                avpriv_request_sample(track->par, "Multiple independent substreams");
+                avpriv_request_sample(mov, "Multiple independent substreams");
                 ret = AVERROR_PATCHWELCOME;
                 goto end;
             } else if (hdr->substreamid < info->num_ind_sub ||
@@ -439,7 +439,7 @@  static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
             }
         } else {
             if (hdr->substreamid != 0) {
-                avpriv_request_sample(track->par, "Multiple dependent substreams");
+                avpriv_request_sample(mov, "Multiple dependent substreams");
                 ret = AVERROR_PATCHWELCOME;
                 goto end;
             }