media: limit size of stderr being logged
authorAntoine Musso <hashar@free.fr>
Wed, 4 Dec 2013 17:00:21 +0000 (18:00 +0100)
committerAntoine Musso <hashar@free.fr>
Fri, 6 Dec 2013 17:27:42 +0000 (18:27 +0100)
commit84c5ba6a1a55d25b82d65512ddeb69bf9f47a8d0
tree6e0637f7e649e098a75611351545144111fa1642
parent96ddd951fb7047607fc7347d18e28588ec974c5c
media: limit size of stderr being logged

Whenever a rendering commands emit a ton of errors (spotted a case
generating 125MB), the call to trim() makes PHP copy the stderr which
might exhaust the remaining available memory.

The new constant MediaHandler::MAX_ERR_LOG_SIZE = 65535 is used to
substr() the error log before it get trimmed and logged.

bug: 57985
Change-Id: Ibd4cf0331529d323a68273163ac230b07a6c6108
includes/media/MediaHandler.php