diracdec: use correct buffer for slice_params_buf realloc

This fixes a double-free detected by AddressSanitizer.

The problem was introduced in commit
dcad4677d6.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun 2016-11-04 18:59:31 +01:00
parent 92280f86b4
commit 8a4ea96448
1 changed files with 1 additions and 1 deletions

View File

@ -907,7 +907,7 @@ static int decode_lowdelay(DiracContext *s)
int slice_num = 0; int slice_num = 0;
if (s->slice_params_num_buf != (s->num_x * s->num_y)) { 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) { if (!s->slice_params_buf) {
av_log(s->avctx, AV_LOG_ERROR, "slice params buffer allocation failure\n"); av_log(s->avctx, AV_LOG_ERROR, "slice params buffer allocation failure\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);