mirror of https://github.com/mpv-player/mpv.git
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:
parent
1826e69af2
commit
43a67970b6
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue