From f9bdb4b0b8f95fd64c9e4544a35b3ca280d2cf26 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Nov 2020 19:47:07 +0100 Subject: lib/ffmpeg/Buffer: add `noexcept` --- src/lib/ffmpeg/Buffer.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/ffmpeg/Buffer.hxx b/src/lib/ffmpeg/Buffer.hxx index c719a2257..330f5ed11 100644 --- a/src/lib/ffmpeg/Buffer.hxx +++ b/src/lib/ffmpeg/Buffer.hxx @@ -27,24 +27,24 @@ extern "C" { #include class FfmpegBuffer { - void *data; - unsigned size; + void *data = nullptr; + unsigned size = 0; public: - FfmpegBuffer():data(nullptr), size(0) {} + FfmpegBuffer() noexcept = default; - ~FfmpegBuffer() { + ~FfmpegBuffer() noexcept { av_free(data); } gcc_malloc - void *Get(size_t min_size) { + void *Get(size_t min_size) noexcept { av_fast_malloc(&data, &size, min_size); return data; } template - T *GetT(size_t n) { + T *GetT(size_t n) noexcept { return (T *)Get(n * sizeof(T)); } }; -- cgit v1.2.3