diff options
author | wm4 <wm4@nowhere> | 2015-11-06 21:12:20 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-06 21:12:20 +0100 |
commit | 9693e0f57ac75bd5c5d8313dd933989dd3e64d31 (patch) | |
tree | d60148c9d7906da869157f8d9b5aa49042af5543 /video/out/vo_vdpau.c | |
parent | 647b360a0aa0a3f8cce75812f9d7eac5a78b7a06 (diff) | |
download | mpv-9693e0f57ac75bd5c5d8313dd933989dd3e64d31.tar.bz2 mpv-9693e0f57ac75bd5c5d8313dd933989dd3e64d31.tar.xz |
Remove some VLAs
They are evil and should be eradicated. Some of these were pretty dumb
anyway.
There are probably some more around in platform specific code or other
code not enabled by default on Linux.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r-- | video/out/vo_vdpau.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 73aae1d45c..72a08adac7 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -651,13 +651,15 @@ static void generate_osd_part(struct vo *vo, struct sub_bitmaps *imgs) CHECK_VDP_WARNING(vo, "OSD: error when creating surface"); } if (imgs->scaled) { - char zeros[sfc->packer->used_width * format_size]; - memset(zeros, 0, sizeof(zeros)); + char *zeros = calloc(sfc->packer->used_width, format_size); + if (!zeros) + return; vdp_st = vdp->bitmap_surface_put_bits_native(sfc->surface, &(const void *){zeros}, &(uint32_t){0}, &(VdpRect){0, 0, sfc->packer->used_width, sfc->packer->used_height}); CHECK_VDP_WARNING(vo, "OSD: error uploading OSD bitmap"); + free(zeros); } if (sfc->surface == VDP_INVALID_HANDLE) |