[FFmpeg-devel] [PATCH 3/6] libopenjpegenc: Merge av_malloc() and memset(0)

Michael Bradshaw mbradshaw at sorensonmedia.com
Fri Nov 18 22:58:14 CET 2011


On Thu, Nov 17, 2011 at 6:32 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/libopenjpegenc.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
> index 31d87e7..13b5456 100644
> --- a/libavcodec/libopenjpegenc.c
> +++ b/libavcodec/libopenjpegenc.c
> @@ -105,12 +105,11 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p
>         return NULL;
>     }
>
> -    cmptparm = av_malloc(numcomps * sizeof(opj_image_cmptparm_t));
> +    cmptparm = av_mallocz(numcomps * sizeof(opj_image_cmptparm_t));
>     if (!cmptparm) {
>         av_log(avctx, AV_LOG_ERROR, "Not enough memory");
>         return NULL;
>     }
> -    memset(cmptparm, 0, numcomps * sizeof(opj_image_cmptparm_t));
>     for (i = 0; i < numcomps; i++) {
>         cmptparm[i].prec = 8;
>         cmptparm[i].bpp = bpp;
> --
> 1.7.4.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Applied.


More information about the ffmpeg-devel mailing list