Skip to content

Commit

Permalink
src/id3.c : Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Apr 2, 2017
1 parent 60b2343 commit f457b7b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/id3.c
@@ -1,5 +1,5 @@
/*
** Copyright (C) 2010-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2010-2017 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -48,9 +48,11 @@ id3_skip (SF_PRIVATE * psf)

/* Calculate new file offset and position ourselves there. */
psf->fileoffset += offset + 10 ;
psf_binheader_readf (psf, "p", psf->fileoffset) ;

return 1 ;
if (psf->fileoffset < psf->filelength)
{ psf_binheader_readf (psf, "p", psf->fileoffset) ;
return 1 ;
} ;
} ;

return 0 ;
Expand Down

0 comments on commit f457b7b

Please sign in to comment.