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)); } };