[FFmpeg-devel] [PATCH] avformat/tee: fix null pointer dereference

Michael Niedermayer michaelni at gmx.at
Tue Dec 17 03:05:57 CET 2013


On Mon, Dec 16, 2013 at 10:51:03AM +0100, Nicolas George wrote:
> Le tridi 23 frimaire, an CCXXII, Michael Niedermayer a écrit :
> > Fixes CID1108584
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/tee.c |   14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/libavformat/tee.c b/libavformat/tee.c
> > index 12ea0ea..e672cce 100644
> > --- a/libavformat/tee.c
> > +++ b/libavformat/tee.c
> > @@ -397,6 +397,13 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
> >                                               &new_pkt.data, &new_pkt.size,
> >                                               pkt->data, pkt->size,
> >                                               pkt->flags & AV_PKT_FLAG_KEY);
> > +        if (ret < 0) {
> > +            av_log(log_ctx, AV_LOG_ERROR,
> > +                "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
> > +                bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
> > +                avcodec_get_name(enc_ctx->codec_id));
> > +        }
> > +
> 
> Stefano knows this part of the code better than me, but I suspect you need
> to add a "break" after the log to preserve the current behaviour and not
> simply ignore the error if it happens in any filter but the last.

the code didnt fail before, iam just moving a av_log



> 
> >          if (ret == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
> >              if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)
> >                  break;
> > @@ -415,13 +422,6 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
> >          bsf_ctx = bsf_ctx->next;
> >      }
> >  
> > -    if (ret < 0) {
> > -        av_log(log_ctx, AV_LOG_ERROR,
> > -               "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
> > -               bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
> > -               avcodec_get_name(enc_ctx->codec_id));
> > -    }
> > -
> >      return ret;
> >  }
> 
> Regards,
> 
> -- 
>   Nicolas George



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131217/538c1b33/attachment.asc>


More information about the ffmpeg-devel mailing list