Commit 8a4ea964 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

diracdec: use correct buffer for slice_params_buf realloc

This fixes a double-free detected by AddressSanitizer.

The problem was introduced in commit
dcad4677.
Reviewed-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 92280f86
......@@ -907,7 +907,7 @@ static int decode_lowdelay(DiracContext *s)
int slice_num = 0;
if (s->slice_params_num_buf != (s->num_x * s->num_y)) {
s->slice_params_buf = av_realloc_f(s->thread_buf, s->num_x * s->num_y, sizeof(DiracSlice));
s->slice_params_buf = av_realloc_f(s->slice_params_buf, s->num_x * s->num_y, sizeof(DiracSlice));
if (!s->slice_params_buf) {
av_log(s->avctx, AV_LOG_ERROR, "slice params buffer allocation failure\n");
return AVERROR(ENOMEM);
......
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