aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrée Ekroth <andree.ekroth@gmail.com>2014-08-08 23:05:24 +0200
committerAndrée Ekroth <andree.ekroth@gmail.com>2014-08-08 23:24:26 +0200
commitec3568bd97b0ea094df4b480b05a81c1d9db35b8 (patch)
treea72e353604d9bb0347396d5e3a725562e5c88638 /src
parent7a048f004dc1c7d35518e38c75861bc167ade945 (diff)
downloadmpd-ec3568bd97b0ea094df4b480b05a81c1d9db35b8.tar.gz
mpd-ec3568bd97b0ea094df4b480b05a81c1d9db35b8.tar.xz
mpd-ec3568bd97b0ea094df4b480b05a81c1d9db35b8.zip
decoder/Mp4v2: fix crash with undefined error
When no track is found the error is now properly set. Previously the calling function tried to log an undefined error, which resulted in a crash. MPD falls back to ffmpeg for unsupported tracks, such as ALAC. This should fix issue 4051.
Diffstat (limited to 'src')
-rw-r--r--src/decoder/plugins/Mp4v2DecoderPlugin.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
index 3cdd97167..36d02c81d 100644
--- a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
+++ b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
@@ -91,15 +91,14 @@ mp4_get_aac_track(MP4FileHandle handle, NeAACDecHandle decoder,
if (!audio_format_init_checked(audio_format, sample_rate,
SampleFormat::S16,
channels,
- error)) {
- error.Set(mp4v2_decoder_domain,
- "Invalid audio format");
+ error))
continue;
- }
return id;
}
+ error.Set(mp4v2_decoder_domain, "no valid aac track found");
+
return MP4_INVALID_TRACK_ID;
}
@@ -117,7 +116,6 @@ mp4_faad_new(MP4FileHandle handle, AudioFormat &audio_format, Error &error)
const auto track = mp4_get_aac_track(handle, decoder, audio_format, error);
if (track == MP4_INVALID_TRACK_ID) {
- LogError(error);
NeAACDecClose(decoder);
return nullptr;
}
@@ -132,7 +130,7 @@ mp4_file_decode(Decoder &mpd_decoder, Path path_fs)
if (handle == MP4_INVALID_FILE_HANDLE) {
FormatError(mp4v2_decoder_domain,
- "Unable to open file");
+ "unable to open file");
return;
}