aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-06-01 10:08:06 +0200
committerGitHub <noreply@github.com>2023-06-01 10:08:06 +0200
commit962dc932d95ce91eb022ad594703b518fe62e7f2 (patch)
tree53993aaa8ad2d14d2a58c8bfa1dbc6968bc0325d
parent4baba4d7e95ba90308c523dadcc7f6d0f93a933b (diff)
parent5630703061ed0e5952968d0bfe7f88e04ba32245 (diff)
downloadnextcloud-server-962dc932d95ce91eb022ad594703b518fe62e7f2.tar.gz
nextcloud-server-962dc932d95ce91eb022ad594703b518fe62e7f2.zip
Merge pull request #38507 from nextcloud/backport/38496/stable27
-rw-r--r--lib/private/Preview/MP3.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Preview/MP3.php b/lib/private/Preview/MP3.php
index 47d752af477..ff6ff86c966 100644
--- a/lib/private/Preview/MP3.php
+++ b/lib/private/Preview/MP3.php
@@ -32,6 +32,7 @@ use ID3Parser\ID3Parser;
use OCP\Files\File;
use OCP\IImage;
+use Psr\Log\LoggerInterface;
class MP3 extends ProviderV2 {
/**
@@ -48,8 +49,18 @@ class MP3 extends ProviderV2 {
$getID3 = new ID3Parser();
$tmpPath = $this->getLocalFile($file);
- $tags = $getID3->analyze($tmpPath);
- $this->cleanTmpFiles();
+ try {
+ $tags = $getID3->analyze($tmpPath);
+ } catch (\Throwable $e) {
+ \OC::$server->get(LoggerInterface::class)->info($e->getMessage(), [
+ 'exception' => $e,
+ 'app' => 'core',
+ ]);
+ return null;
+ } finally {
+ $this->cleanTmpFiles();
+ }
+
$picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null;
if (is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) {
$picture = $tags['id3v2']['PIC'][0]['data'];