Hi,

On Thu, Apr 8, 2010 at 12:02 PM, spyfeng <[email protected]> wrote:
>                             mms->asf_header = av_realloc(mms->asf_header,
>                                               mms->asf_header_size
>                                               + mms->pkt_buf_len);
> -                            if (!mms->asf_header)
> +                            if (!mms->asf_header) {
> +                                av_freep(&mms->asf_header);
>                                 return AVERROR(ENOMEM);
> +                            }
>                             memcpy(mms->asf_header + mms->asf_header_size,
>                                                  mms->pkt_read_ptr,
>                                                  mms->pkt_buf_len);

You now this won't work right? :-). You're assigning NULL to a pointer
and then free'ing it. You'll want to save the return value of
av_realloc() into a new pointer, check the value, free()
mms->asf_header if it failed, and else overwrite mms->asf_header.

Ronald
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to