diff options
author | wm4 <wm4@nowhere> | 2018-10-14 15:51:36 +0200 |
---|---|---|
committer | Anton Kindestam <antonki@kth.se> | 2018-12-06 10:34:06 +0100 |
commit | 32385a784c747997199d49cb15cffe455208564e (patch) | |
tree | 4a0349c24520e90d57d2cd646157c81427bf417f /sub | |
parent | af9722cd3e9def4b09d50b6418e926567977b99b (diff) | |
download | mpv-32385a784c747997199d49cb15cffe455208564e.tar.bz2 mpv-32385a784c747997199d49cb15cffe455208564e.tar.xz |
osd: another shitty pointless UB
The pointer could be NULL if the number of bytes to copy was 0. In a
sane world, this would be fine, but not the current world.
Diffstat (limited to 'sub')
-rw-r--r-- | sub/osd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -217,8 +217,10 @@ void osd_set_progbar(struct osd_state *osd, struct osd_progbar_state *s) osd_obj->progbar_state.value = s->value; osd_obj->progbar_state.num_stops = s->num_stops; MP_TARRAY_GROW(osd_obj, osd_obj->progbar_state.stops, s->num_stops); - memcpy(osd_obj->progbar_state.stops, s->stops, - sizeof(osd_obj->progbar_state.stops[0]) * s->num_stops); + if (s->num_stops) { + memcpy(osd_obj->progbar_state.stops, s->stops, + sizeof(osd_obj->progbar_state.stops[0]) * s->num_stops); + } osd_obj->osd_changed = true; osd->want_redraw_notification = true; pthread_mutex_unlock(&osd->lock); |