[FFmpeg-cvslog] nutenc: check malloc return values.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu May 5 07:33:28 CEST 2011


On Thu, May 05, 2011 at 03:30:44AM +0200, Ronald S. Bultje wrote:
> ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Tue May  3 08:19:42 2011 -0400| [76432655056b9c1477ade550e4b6d277556eb6b2] | committer: Ronald S. Bultje
> 
> nutenc: check malloc return values.
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76432655056b9c1477ade550e4b6d277556eb6b2
> ---
> 
>  libavformat/nutenc.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index 4ca761a..85340b1 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -588,6 +588,12 @@ static int write_header(AVFormatContext *s){
>          nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
>      nut->time_base= av_mallocz(sizeof(AVRational   )*(s->nb_streams +
>                                                        s->nb_chapters));
> +    if (!nut->stream || (s->nb_chapters && !nut->chapter) || !nut->time_base) {

The s->nb_chapters condition is not necessary (in our code).


More information about the ffmpeg-cvslog mailing list