af_scaletempo: fix theoretical UB

Passing NULL to memset() is undefined behavior, even if the size
argument is 0. Could happen on init errors and such.
This commit is contained in:
wm4 2020-05-23 03:49:46 +02:00
parent 1826e69af2
commit 43a67970b6
1 changed files with 2 additions and 1 deletions

View File

@ -538,7 +538,8 @@ static void reset(struct mp_filter *f)
s->bytes_queued = 0;
s->bytes_to_slide = 0;
s->frames_stride_error = 0;
memset(s->buf_overlap, 0, s->bytes_overlap);
if (s->buf_overlap && s->bytes_overlap)
memset(s->buf_overlap, 0, s->bytes_overlap);
TA_FREEP(&s->in);
}