avcodec/cfhdenc: free alpha buffer on closing

pull/352/head
Paul B Mahol 4 years ago
parent 0a8742a1e6
commit 14b84a2e99
  1. 5
      libavcodec/cfhdenc.c

@ -356,6 +356,9 @@ static av_cold int cfhd_encode_init(AVCodecContext *avctx)
s->lut[i] = last;
}
if (s->planes != 4)
return 0;
s->alpha = av_calloc(avctx->width * avctx->height, sizeof(*s->alpha));
if (!s->alpha)
return AVERROR(ENOMEM);
@ -864,6 +867,8 @@ static av_cold int cfhd_encode_close(AVCodecContext *avctx)
s->plane[i].l_h[j] = NULL;
}
av_freep(&s->alpha);
return 0;
}

Loading…
Cancel
Save