From f8824345475ff521a92f882a0cbcbcc3ee4e9e28 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Jan 2014 11:22:06 +0100 Subject: configure.ac: prepare for 0.18.8 --- NEWS | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index d59f4614d..731aa6bb4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.18.8 (not yet released) + ver 0.18.7 (2013/01/13) * playlist - pls: fix crash after parser error diff --git a/configure.ac b/configure.ac index 2cd0c7720..b176aeedd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.18.7, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.18.8, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=18 -- cgit v1.2.3 From c91e08fbfd257313fa7950cdb0c81657b9e1b173 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 21:38:08 +0100 Subject: OutputAPI: fix typo in include guard --- src/OutputAPI.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OutputAPI.hxx b/src/OutputAPI.hxx index 73cbaf183..e905fd9db 100644 --- a/src/OutputAPI.hxx +++ b/src/OutputAPI.hxx @@ -18,7 +18,7 @@ */ #ifndef MPD_OUTPUT_API_HXX -#define MPD_OUTPUT_API_HxX +#define MPD_OUTPUT_API_HXX #include "OutputPlugin.hxx" #include "OutputInternal.hxx" -- cgit v1.2.3 From a1b798e555a47a63470edb69d0b3786aae003776 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 22:40:07 +0100 Subject: SongFilter, TagConfig: cast TAG_NUM_OF_ITEM_TYPES to integer Fixes clang warning. --- src/SongFilter.cxx | 2 +- src/tag/TagConfig.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SongFilter.cxx b/src/SongFilter.cxx index 8d90c5fc8..49c966b6f 100644 --- a/src/SongFilter.cxx +++ b/src/SongFilter.cxx @@ -101,7 +101,7 @@ bool SongFilter::Item::Match(const Tag &_tag) const { bool visited_types[TAG_NUM_OF_ITEM_TYPES]; - std::fill_n(visited_types, TAG_NUM_OF_ITEM_TYPES, false); + std::fill_n(visited_types, size_t(TAG_NUM_OF_ITEM_TYPES), false); for (unsigned i = 0; i < _tag.num_items; i++) { visited_types[_tag.items[i]->type] = true; diff --git a/src/tag/TagConfig.cxx b/src/tag/TagConfig.cxx index 96fd1847f..b8be4fc4c 100644 --- a/src/tag/TagConfig.cxx +++ b/src/tag/TagConfig.cxx @@ -39,7 +39,7 @@ TagLoadConfig() if (value == nullptr) return; - std::fill_n(ignore_tag_items, TAG_NUM_OF_ITEM_TYPES, true); + std::fill_n(ignore_tag_items, size_t(TAG_NUM_OF_ITEM_TYPES), true); if (StringEqualsCaseASCII(value, "none")) return; -- cgit v1.2.3 From 56f082c9d46eefda3057b962d15dac50d25b690d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 23:07:04 +0100 Subject: util/PeakBuffer: fix nullptr dereference when peak_size==0 --- src/util/PeakBuffer.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/PeakBuffer.cxx b/src/util/PeakBuffer.cxx index a3659b8f4..d9b193dd1 100644 --- a/src/util/PeakBuffer.cxx +++ b/src/util/PeakBuffer.cxx @@ -130,8 +130,9 @@ PeakBuffer::Append(const void *data, size_t length) return true; } - if (peak_buffer == nullptr && peak_size > 0) { - peak_buffer = (fifo_buffer *)HugeAllocate(peak_size); + if (peak_buffer == nullptr) { + if (peak_size > 0) + peak_buffer = (fifo_buffer *)HugeAllocate(peak_size); if (peak_buffer == nullptr) return false; -- cgit v1.2.3 From 5b6bb114add8f4aac9a9434cd723e5062ae2461f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 23:16:07 +0100 Subject: decoder/ffmpeg: check for av_samples_get_buffer_size() errors Fixes potential nullptr dereference. --- src/decoder/FfmpegDecoderPlugin.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx index 47e1a3384..c99ecebe3 100644 --- a/src/decoder/FfmpegDecoderPlugin.cxx +++ b/src/decoder/FfmpegDecoderPlugin.cxx @@ -223,6 +223,9 @@ copy_interleave_frame(const AVCodecContext *codec_context, codec_context->channels, frame->nb_samples, codec_context->sample_fmt, 1); + if (data_size <= 0) + return data_size; + if (av_sample_fmt_is_planar(codec_context->sample_fmt) && codec_context->channels > 1) { if(*global_buffer_size < data_size) { -- cgit v1.2.3 From b7d6133593dcfca7b52eff13985f10a39098862f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Jan 2014 11:31:51 +0100 Subject: decoder/ffmpeg: include cleanup --- src/decoder/FfmpegDecoderPlugin.cxx | 1 - src/decoder/FfmpegMetaData.hxx | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx index c99ecebe3..1876425e2 100644 --- a/src/decoder/FfmpegDecoderPlugin.cxx +++ b/src/decoder/FfmpegDecoderPlugin.cxx @@ -38,7 +38,6 @@ extern "C" { #include #include #include -#include } #include diff --git a/src/decoder/FfmpegMetaData.hxx b/src/decoder/FfmpegMetaData.hxx index 0fd73df04..998cdf5a8 100644 --- a/src/decoder/FfmpegMetaData.hxx +++ b/src/decoder/FfmpegMetaData.hxx @@ -21,8 +21,6 @@ #define MPD_FFMPEG_METADATA_HXX extern "C" { -#include -#include #include } @@ -35,6 +33,6 @@ struct tag_handler; void ffmpeg_scan_dictionary(AVDictionary *dict, - const struct tag_handler *handler, void *handler_ctx); + const tag_handler *handler, void *handler_ctx); #endif -- cgit v1.2.3 From 313d1d5d8379ce8c0763f43775e767832942a7ef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Jan 2014 11:13:50 +0100 Subject: decoder/ffmpeg: support libav v10_alpha1 --- NEWS | 2 ++ src/decoder/FfmpegDecoderPlugin.cxx | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 731aa6bb4..a9c711e9c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.18.8 (not yet released) +* decoder + - ffmpeg: support libav v10_alpha1 ver 0.18.7 (2013/01/13) * playlist diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx index 1876425e2..593f42d39 100644 --- a/src/decoder/FfmpegDecoderPlugin.cxx +++ b/src/decoder/FfmpegDecoderPlugin.cxx @@ -38,6 +38,10 @@ extern "C" { #include #include #include + +#if LIBAVUTIL_VERSION_MAJOR >= 53 +#include +#endif } #include @@ -453,7 +457,11 @@ ffmpeg_decode(Decoder &decoder, InputStream &input) decoder_initialized(decoder, audio_format, input.seekable, total_time); +#if LIBAVUTIL_VERSION_MAJOR >= 53 + AVFrame *frame = av_frame_alloc(); +#else AVFrame *frame = avcodec_alloc_frame(); +#endif if (!frame) { LogError(ffmpeg_domain, "Could not allocate frame"); avformat_close_input(&format_context); @@ -497,7 +505,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input) } } while (cmd != DecoderCommand::STOP); -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0) +#if LIBAVUTIL_VERSION_MAJOR >= 53 + av_frame_free(&frame); +#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0) avcodec_free_frame(&frame); #else av_freep(&frame); -- cgit v1.2.3