mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
id3v2: ignore RVA2 tags with more than 64 peak bits
The spec for this does not say nor imply how this should be interpreted. The previous code would try to shift by 64 bits, which is undefined. Coverity 1195119 https://bugzilla.gnome.org/show_bug.cgi?id=727955
This commit is contained in:
parent
985ed4847f
commit
e2a9f0ef4e
1 changed files with 10 additions and 5 deletions
|
@ -656,11 +656,16 @@ parse_relative_volume_adjustment_two (ID3TagsWorking * work)
|
|||
}
|
||||
}
|
||||
|
||||
peak = peak << (64 - GST_ROUND_UP_8 (peak_bits));
|
||||
peak_val =
|
||||
gst_guint64_to_gdouble (peak) / gst_util_guint64_to_gdouble (G_MAXINT64);
|
||||
GST_LOG ("RVA2 frame: id=%s, chan=%u, adj=%.2fdB, peak_bits=%u, peak=%.2f",
|
||||
id, chan, gain_dB, (guint) peak_bits, peak_val);
|
||||
if (peak_bits > 0) {
|
||||
peak = peak << (64 - GST_ROUND_UP_8 (peak_bits));
|
||||
peak_val =
|
||||
gst_guint64_to_gdouble (peak) /
|
||||
gst_util_guint64_to_gdouble (G_MAXINT64);
|
||||
GST_LOG ("RVA2 frame: id=%s, chan=%u, adj=%.2fdB, peak_bits=%u, peak=%.2f",
|
||||
id, chan, gain_dB, (guint) peak_bits, peak_val);
|
||||
} else {
|
||||
peak_val = 0;
|
||||
}
|
||||
|
||||
if (chan == ID3V2_RVA2_CHANNEL_MASTER && strcmp (id, "track") == 0) {
|
||||
gain_tag_name = GST_TAG_TRACK_GAIN;
|
||||
|
|
Loading…
Reference in a new issue