# HG changeset patch # User nenolod # Date 1141445064 28800 # Node ID 4dcda61511f7d7fd5ca0d4ad4089e38c8bd12db4 # Parent d15862899bbe1f479bf677dd7167560e7e1dbedf [svn] - iteration pacing against id3_read_frame() since we cannot trust all tags to behave properly. diff -r d15862899bbe -r 4dcda61511f7 Plugins/Input/mpg123/id3_tag.c --- a/Plugins/Input/mpg123/id3_tag.c Fri Mar 03 19:26:54 2006 -0800 +++ b/Plugins/Input/mpg123/id3_tag.c Fri Mar 03 20:04:24 2006 -0800 @@ -71,6 +71,7 @@ id3_read_tag(struct id3_tag *id3) { char *buf; + gint cyc = 0; /* deal with malformed tags gracefully through iteration pacing */ /* * We know that the tag will be at least this big. @@ -128,6 +129,10 @@ while (id3->id3_pos < id3->id3_tagsize) { if (id3_read_frame(id3) == -1) return -1; + + /* 100 iterations, this ID3 is definately hosed */ + if (++cyc == 100) + return -1; } return 0;