On Wed, Apr 02, 2014 at 12:07:11PM +0530, Nidhi Makhijani wrote:
> ---
>  libavformat/nutdec.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)

It would be nice if you could use --annotate on your patches to explain
what changed between iterations.  Additional good karma for --in-reply-to
and correct reply threading.

> --- a/libavformat/nutdec.c
> +++ b/libavformat/nutdec.c
> @@ -230,7 +230,8 @@ static int decode_main_header(NUTContext *nut)
>      nut->time_base = av_malloc(nut->time_base_count * sizeof(AVRational));
> -
> +    if (!nut->time_base)
> +        return AVERROR(ENOMEM);
>      for (i = 0; i < nut->time_base_count; i++) {
> @@ -326,6 +327,8 @@ static int decode_main_header(NUTContext *nut)
>      nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);
> +    if (!nut->stream)
> +        return AVERROR(ENOMEM);
>      for (i = 0; i < stream_count; i++)
>          avformat_new_stream(s, NULL);

These two allocations happen in the same function, so again you have to
take care to free up allocated memory before returning.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to