[xiph-cvs] cvs commit: icecast/src format_vorbis.c
Michael Smith
msmith at xiph.org
Fri Aug 9 21:51:11 PDT 2002
msmith 02/08/10 00:51:11
Modified: src format_vorbis.c
Log:
Better error messages on some corrupt sources.
Revision Changes Path
1.8 +9 -3 icecast/src/format_vorbis.c
Index: format_vorbis.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/format_vorbis.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- format_vorbis.c 3 Jun 2002 09:12:50 -0000 1.7
+++ format_vorbis.c 10 Aug 2002 04:51:11 -0000 1.8
@@ -16,6 +16,10 @@
#include "stats.h"
#include "format.h"
+#define CATMODULE "format-vorbis"
+#include "log.h"
+#include "logging.h"
+
#define MAX_HEADER_PAGES 10
typedef struct _vstate_tag
@@ -155,17 +159,19 @@
}
/* cache header pages */
- if (state->header > 0) {
+ if (state->header > 0 && state->packets < 3) {
if(state->header > MAX_HEADER_PAGES) {
refbuf_release(refbuf);
+ ERROR1("Bad vorbis input: header is more than %d pages long", MAX_HEADER_PAGES);
+
return -1;
}
refbuf_addref(refbuf);
state->headbuf[state->header - 1] = refbuf;
- if (state->packets >= 0 && state->packets < 2) {
+ if (state->packets >= 0 && state->packets < 3) {
ogg_stream_pagein(&state->os, &state->og);
- while (state->packets < 2) {
+ while (state->packets < 3) {
result = ogg_stream_packetout(&state->os, &op);
if (result == 0) break; /* need more data */
if (result < 0) {
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list