Commit c1b282dc authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

dcaenc: fix segfault when attempting to encode with invalid samplerate

Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent a1c6fc77
......@@ -152,8 +152,11 @@ static int subband_bufer_alloc(DCAEncContext *c)
static void subband_bufer_free(DCAEncContext *c)
{
int32_t *bufer = c->subband[0][0] - DCA_ADPCM_COEFFS;
av_freep(&bufer);
if (c->subband[0][0]) {
int32_t *bufer = c->subband[0][0] - DCA_ADPCM_COEFFS;
av_free(bufer);
c->subband[0][0] = NULL;
}
}
static int encode_init(AVCodecContext *avctx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment