mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
Better error messages on some corrupt sources.
svn path=/trunk/icecast/; revision=3796
This commit is contained in:
parent
5d06975c44
commit
e97e404904
@ -16,6 +16,10 @@
|
|||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
|
||||||
|
#define CATMODULE "format-vorbis"
|
||||||
|
#include "log.h"
|
||||||
|
#include "logging.h"
|
||||||
|
|
||||||
#define MAX_HEADER_PAGES 10
|
#define MAX_HEADER_PAGES 10
|
||||||
|
|
||||||
typedef struct _vstate_tag
|
typedef struct _vstate_tag
|
||||||
@ -155,17 +159,19 @@ int format_vorbis_get_buffer(format_plugin_t *self, char *data, unsigned long le
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* cache header pages */
|
/* cache header pages */
|
||||||
if (state->header > 0) {
|
if (state->header > 0 && state->packets < 3) {
|
||||||
if(state->header > MAX_HEADER_PAGES) {
|
if(state->header > MAX_HEADER_PAGES) {
|
||||||
refbuf_release(refbuf);
|
refbuf_release(refbuf);
|
||||||
|
ERROR1("Bad vorbis input: header is more than %d pages long", MAX_HEADER_PAGES);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
refbuf_addref(refbuf);
|
refbuf_addref(refbuf);
|
||||||
state->headbuf[state->header - 1] = 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);
|
ogg_stream_pagein(&state->os, &state->og);
|
||||||
while (state->packets < 2) {
|
while (state->packets < 3) {
|
||||||
result = ogg_stream_packetout(&state->os, &op);
|
result = ogg_stream_packetout(&state->os, &op);
|
||||||
if (result == 0) break; /* need more data */
|
if (result == 0) break; /* need more data */
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user