| Summary: | [PATCH] crash reading broken/short text frame | ||
|---|---|---|---|
| Product: | [Unmaintained] taglib | Reporter: | Tim-Philipp M <t.i.m> |
| Component: | general | Assignee: | Scott Wheeler <wheeler> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | proposed fix: don't crash if there isn't enough data | ||
|
Description
Tim-Philipp M
2006-11-20 20:22:45 UTC
Created attachment 18629 [details]
proposed fix: don't crash if there isn't enough data
I think this is a better solution:
=== modified file 'taglib/mpeg/id3v2/id3v2framefactory.cpp'
--- taglib/mpeg/id3v2/id3v2framefactory.cpp 2007-02-04 21:52:47 +0000
+++ taglib/mpeg/id3v2/id3v2framefactory.cpp 2007-02-05 09:27:44 +0000
@@ -70,7 +70,7 @@
// A quick sanity check -- make sure that the frameID is 4 uppercase Latin1
// characters. Also make sure that there is data in the frame.
- if(!frameID.size() == (version < 3 ? 3 : 4) || header->frameSize() <= 0) {
+ if(!frameID.size() == (version < 3 ? 3 : 4) || header->frameSize() <= (header->dataLengthIndicator() ? 4 : 0)) {
delete header;
return 0;
}
SVN commit 633133 by wheeler:
Don't try to parse invalid frames.
BUG:137635
M +5 -0 textidentificationframe.cpp
--- trunk/kdesupport/taglib/taglib/mpeg/id3v2/frames/textidentificationframe.cpp #633132:633133
@@ -94,6 +94,11 @@
void TextIdentificationFrame::parseFields(const ByteVector &data)
{
+ // Don't try to parse invalid frames
+
+ if(data.size() < 2)
+ return;
+
// read the string data type (the first byte of the field data)
d->textEncoding = String::Type(data[0]);
|