diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6d7401bfdd..856508ca77 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1940,6 +1940,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, if (size < cfs * h / 2) { av_log(matroska->ctx, AV_LOG_ERROR, "Corrupt int4 RM-style audio packet size\n"); + av_free(lace_size); return AVERROR_INVALIDDATA; } for (x=0; xctx, AV_LOG_ERROR, "Corrupt sipr RM-style audio packet size\n"); + av_free(lace_size); return AVERROR_INVALIDDATA; } memcpy(track->audio.buf + y*w, data, w); @@ -1956,6 +1958,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, if (size < sps * w / sps) { av_log(matroska->ctx, AV_LOG_ERROR, "Corrupt generic RM-style audio packet size\n"); + av_free(lace_size); return AVERROR_INVALIDDATA; } for (x=0; x