mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-10-11 16:44:42 -04:00
HDR: Limits the header to the first 128 lines
The HDR header is a set of text information spread across a few lines. According to the specifications I have, the parameters seem to be a total of 7 / 8 but there could be more. This patch limits the header to 128 lines of maximum 1024 bytes. Closes #40
This commit is contained in:
committed by
Albert Astals Cid
parent
463da81fad
commit
6881e3111b
@ -126,6 +126,7 @@ public:
|
|||||||
{
|
{
|
||||||
Header h;
|
Header h;
|
||||||
|
|
||||||
|
int cnt = 0;
|
||||||
int len;
|
int len;
|
||||||
QByteArray line(MAXLINE + 1, Qt::Uninitialized);
|
QByteArray line(MAXLINE + 1, Qt::Uninitialized);
|
||||||
QByteArray format;
|
QByteArray format;
|
||||||
@ -167,7 +168,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} while ((len > 0) && (line[0] != '\n'));
|
} while ((len > 0) && (line[0] != '\n') && (cnt++ < 128));
|
||||||
|
|
||||||
if (format != "32-bit_rle_rgbe") {
|
if (format != "32-bit_rle_rgbe") {
|
||||||
qCDebug(HDRPLUGIN) << "Unknown HDR format:" << format;
|
qCDebug(HDRPLUGIN) << "Unknown HDR format:" << format;
|
||||||
|
Reference in New Issue
Block a user