Permalink
Browse files

bugfix: possible memory leak in OggFLAC

  • Loading branch information...
1 parent 6db5d83 commit a9443d559def6ab07489698a5b60c3c58da0e67e @JamesHeinrich committed May 14, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 getid3/module.audio.ogg.php
@@ -505,6 +505,12 @@ public function ParseVorbisComments() {
$ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw'];
for ($i = 0; $i < $CommentsCount; $i++) {
+ if ($i >= 10000) {
+ // https://github.com/owncloud/music/issues/212#issuecomment-43082336
+ $info['warning'][] = 'Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments';
+ break 2;
+ }
+
$ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset;
if ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) {

0 comments on commit a9443d5

Please sign in to comment.