Skip to content

Commit f457b7b

Browse files
committed
src/id3.c : Improve error handling
1 parent 60b2343 commit f457b7b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/id3.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** Copyright (C) 2010-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
2+
** Copyright (C) 2010-2017 Erik de Castro Lopo <erikd@mega-nerd.com>
33
**
44
** This program is free software; you can redistribute it and/or modify
55
** it under the terms of the GNU Lesser General Public License as published by
@@ -48,9 +48,11 @@ id3_skip (SF_PRIVATE * psf)
4848

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

53-
return 1 ;
52+
if (psf->fileoffset < psf->filelength)
53+
{ psf_binheader_readf (psf, "p", psf->fileoffset) ;
54+
return 1 ;
55+
} ;
5456
} ;
5557

5658
return 0 ;

0 commit comments

Comments
 (0)