Commit Graph
105 Commits
Author SHA1 Message Date
Acts1631andGitHub cb92e0aec4 MPC: validate SV8 packet size (#1391)
SV8 packet parsing subtracted its header size from an unchecked
unsigned packet length. An undersized value could wrap and make the
parser allocate the remainder of a large file.

Reject packet lengths smaller than their header or beyond the remaining
file data before reading the payload.
2026-08-03 15:46:46 +02:00
FelipeandGitHub d466b72eea docs: Some improvements to the documentation (#1337)
Make MP4 AtomDataType descriptions visible in the generated documentation.
Convert the ID3v2 text frame listing into a table.
Convert the shorten `fileType()` documentation into a table.
Fix some typos.
Add link to specification in `EventType` for consistency with other headers.
2026-04-13 20:05:53 +02:00
Urs Fleisch 148cc9a921 Fix conversion compiler warnings
Using a release build with GCC 14.2.0 and -Wextra -Wconversion -Wall.
The generated binaries are not changed by this commit.
2025-06-25 22:08:09 +02:00
Rosen PenevandUrs Fleisch e1ac724cfe convert const double to const auto
Fixes some Wconversion warnings.

Signed-off-by: Rosen Penev <[email protected]>
2024-01-22 18:35:30 +01:00
Urs Fleisch 7bcfb96098 Inspection: Code redundancies 2024-01-21 20:46:27 +01:00
Urs Fleisch 580b0b0c82 Inspection: Possibly unused #include directive 2024-01-21 20:46:27 +01:00
Urs Fleisch 613355665c Inspection: Variable can be moved to inner scope 2024-01-21 20:46:27 +01:00
Urs Fleisch dfe2aa5253 Inspection: Variable can be moved to init statement 2024-01-21 20:46:27 +01:00
Urs Fleisch 5d921c6325 Inspection: Variable can be made constexpr 2024-01-21 20:46:27 +01:00
Urs Fleisch fb0f7dfa57 More API documentation corrections 2024-01-17 20:54:56 +01:00
Urs Fleisch c5d798a50d Correct the API documentation 2024-01-04 17:18:23 +01:00
Stephen F. BoothandUrs Fleisch c9f7772198 Use unsigned long for sampleFrames 2023-12-18 17:29:39 +01:00
Urs Fleisch c9486731d9 Fix MSVC warning needs to have dll-interface (#1185)
Unfortunately, MSVC exports everything (not only public members) when
__declspec(dllexport) is set at the class level via TAGLIB_EXPORT, which
leads to many "needs to have dll-interface to be used by clients" 4251
warnings issued by MSVC, because the std::unique_ptr pimpls are
exported too. As it is not possible to "unexport" private members,
such a warning has to be explicitly suppressed for these cases or
all public and protected class member now have to be exported
for classes derived from a template (StringList, ByteVectorList,
PropertyMap).
2023-12-11 06:35:08 +01:00
Urs Fleisch 131918333b Fix issues reported by Clang Static Analyzer
Some deadcode.DeadStores.

On Debian 12:
CXXFLAGS=-I/usr/include/x86_64-linux-gnu/c++/12 \
cmake -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-14/libexec/ccc-analyzer \
    -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-14/libexec/c++-analyzer \
    -DBUILD_SHARED_LIBS=OFF \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
    -DENABLE_CCACHE=ON -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON \
    -DCMAKE_BUILD_TYPE=Debug ../taglib
scan-build make
2023-12-07 05:00:00 +01:00
Urs Fleisch c86a2fce70 Fix MPC content check in presence of ID3v2 tag 2023-11-23 16:41:13 +01:00
Rosen PenevandGitHub e275abb8a3 Convert private raw pointers to unique_ptr (#1127)
Simplifies the code quite a bit.
2023-09-23 06:46:05 +02:00
Rosen PenevandGitHub bdf50eda99 use some more auto (#1146) 2023-09-16 13:12:04 +02:00
7646184d6b unused includes (#1133)
* unused includes

Signed-off-by: Rosen Penev <[email protected]>

* Use consistent order of includes

Always include in the following order:
- Own header files
- Standard header files
- System header files
- Project header files (toolkit first)

Exceptions:
- cppunit/extensions/HelperMacros.h must be included after
  header files declaring stream operators
- config.h must be included before its definitions are used

---------

Signed-off-by: Rosen Penev <[email protected]>
Co-authored-by: Urs Fleisch <[email protected]>
2023-09-16 08:22:36 +02:00
Rosen PenevandGitHub cdc87aec10 clang-tidy: init members by default (#1110)
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <[email protected]>
2023-08-30 16:26:14 +02:00
Rosen PenevandGitHub 185bb7042e Use unique_ptr for d-pointers (#1095)
* clang-tidy: make deleted members public

One oversight of modernize-use-equals-delete is that the C++11 way of
doing this is to make it public, which makes the warning still trigger.

Signed-off-by: Rosen Penev <[email protected]>

* clang-tidy: add missing deleted functions

Found with cppcoreguidelines-special-member-functions

Signed-off-by: Rosen Penev <[email protected]>

* unique_ptr conversions

unique_ptr is a safer and cleaner way to handle d pointers.

Also added missing = default.

Signed-off-by: Rosen Penev <[email protected]>

---------

Signed-off-by: Rosen Penev <[email protected]>
2023-08-07 15:08:40 -05:00
Rosen PenevandGitHub dcef356e3f Replace raw buffers with std containers (#1101)
Signed-off-by: Rosen Penev <[email protected]>
2023-08-06 17:46:59 -05:00
Urs Fleisch d314bfa06a Make sure that own header file is included first
Each header corresponding to a .cpp file must be self-contained,
and can be #included without prerequisites.
2023-07-22 07:09:58 +02:00
Urs Fleisch cc7d23cdf5 Consistently use quote form when including our own headers 2023-07-22 07:09:58 +02:00
Urs Fleisch 2a1fb27735 clang-tidy: Replace C headers with C++ alternatives
run-clang-tidy -header-filter='.*' -checks='-*,modernize-deprecated-headers'

Fixed manually as automatic fix would shuffle headers around.
2023-07-22 07:09:58 +02:00
Urs Fleisch 231772b2ad clang-tidy: Delete unimplemented private constructors
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-equals-delete' -fix
2023-07-22 07:09:58 +02:00
Urs Fleisch abc6c31890 clang-tidy: Use nullptr instead of 0
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix
2023-07-22 07:09:58 +02:00
Urs Fleisch 9867bc947e clang-tidy: Use override keyword
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-override' -fix
2023-07-22 07:09:58 +02:00
Urs Fleisch ceb142c9bd Remove functions documented (but not marked) as deprecated
Clean up other stuff with comments about binary incompatibility,
but only as far as to mostly keep source compatibility.
2023-07-09 07:01:37 +02:00
Urs Fleisch a33cc0635a Remove deprecated stuff 2023-07-09 07:01:37 +02:00
Urs Fleisch ca8c2e07ec Support large files over 2GB on Windows (#1089)
Backport of 4dcf0b41c6
b01f45e141
https://github.com/taglib/taglib/pull/77

Tested with files larger than 2GB which have been created using

sox -n -r 44100 -C 320 large.mp3 synth 58916 sine 440 channels 2
sox -n -r 44100 -C 0 large.flac synth 25459 sine 440 channels 2
sox -n -r 44100 -C 10 large.ogg synth 229806 sine 440 channels 2
sox -n -r 44100 large.wav synth 6692 sine 440 channels 2
ffmpeg -f lavfi -i "sine=frequency=440:duration=244676" -y large.m4a

The only file which was readable with the tagreader example
before this commit was large.ogg. The problem is that long on
Windows is only 32-bit (also in LLP64 data model of 64-bit
compilation target) and all the file offsets using long are
too small for large files. Now long is replaced by offset_t
(defined to be long long on Windows and off_t on UNIX) for such
cases and some unsigned long are now size_t, which has the
correct size even on Windows.
2023-07-09 07:01:37 +02:00
Rosen PenevandUrs Fleisch 4dc6bdcd28 clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <[email protected]>
2022-11-28 07:04:42 +01:00
Urs Fleisch 084108a908 Document replacements for deprecated functions (#1001) 2022-10-26 15:42:49 +02:00
Rosen PenevandUrs Fleisch 68ac7c3106 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <[email protected]>
2021-06-21 06:49:32 +02:00
Rosen PenevandUrs Fleisch 38d1d4c21c clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <[email protected]>
2021-06-21 06:49:32 +02:00
bobsayshilolandUrs Fleisch f2eb331696 MPC: Fix heap-buffer-overflow in readSV7()
If `data` is an allocation of only 3 bytes (MP+) then `data[3]` is a
read past the end of the buffer.
2021-05-02 12:14:27 +02:00
Scott Wheeler ebd3373d6d Correctly decode signed values
In SV7 these are a mix of signed and unsigned shorts; in SV8 they're all
signed.  Storing them as an int is fine for signed or unsigned shorts as
it's wide enough to contain either of them.

Unfortunately there are no explicit tests for SV7 at the moment; that
would be ideal to add before the next release.

CC @carewolf
2019-09-12 12:13:24 +02:00
Scott Wheeler 7082b9f66b Unsaved (and incorrect looking) field 2019-09-12 10:46:11 +02:00
Scott Wheeler c05fa78406 Mark deprected methods and remove internal usage
This does not put the deprecated marker on methods that will or could resolve
to the same overload, e.g.:

void foo(bool bar = true); // <-- not marked
void foo(Bar bar) // <-- since this will have a default argument in the new version
2019-09-11 00:39:37 +02:00
Tsuda Kageyu f76b1e5429 Rename the functions 'isValidStream' to 'isSupported'.
The name 'isValidStream' is a little misleading because it doesn't check if the stream is really valid. Additionally, 'isSupported' can be naturally overloaded.
2017-02-07 22:36:56 +09:00
Tsuda Kageyu 931bb042c3 Enable FileRef to detect file types by the actual content of a stream.
FileRef doesn't work with ByteVectorStream as reported at #796, since ByteVectorStream is not associated with a file name and FileRef detects file types based on file extensions.
This commit makes FileRef to work with ByteVectorStream by enabling it to detect file types based on the actual content of a stream.
2017-02-04 23:31:08 +09:00
Tsuda Kageyu d0238ba82f Avoid the risk of subtracting between signed and unsigned types. 2015-12-21 11:44:25 +09:00
Tsuda Kageyu 6d27a1013d Merge pull request #687 from TsudaKageyu/save-mpc
Fix saving MPC files.
2015-12-18 09:00:45 +09:00
Tsuda Kageyu a0b8683656 Use a standard type rather than TagLib::uint.
This won't break the ABI compatibility.
2015-12-03 02:15:41 +09:00
Tsuda Kageyu 085a0ef298 Use a standard type rather than TagLib::ulong.
This won't break the ABI compatibility.
2015-12-03 00:03:06 +09:00
Tsuda Kageyu dcc0fe553c Use a standard type rather than TagLib::ushort.
This won't break the ABI compatibility.
2015-12-02 18:59:45 +09:00
Tsuda Kageyu 83ffc87598 Surround some internal stuff by anonymous namespaces. 2015-12-02 12:00:43 +09:00
Tsuda Kageyu 083eadec60 Fix saving MPC files.
This fixes the issue reported at #624.
2015-11-27 00:53:03 +09:00
Tsuda Kageyu fa4289e044 Fix instance references to a static member function. 2015-11-24 16:36:50 +09:00
Tsuda Kageyu b592f78238 Unify common functions for finding tags.
Several classes have exactly identical functions for finding tags.
This also hides the functions from public headers.
2015-11-21 09:30:04 +09:00
Tsuda Kageyu c5cf9b93bc Fix segfaults when calling File::properties() after strip().
Backport TagUnion::properties() and TagUnion::removeUnsupportedProperties() from taglib2.
2015-08-25 11:03:00 +09:00