summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-19 19:56:47 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-19 19:56:47 +0200
commitfcc3040f10598f477f2251609a65062cb96d9d8c (patch)
tree4df57f6e51817b0e9c54adc592beefcc82bc0834 /plugins/mpgmad
parent4737a19e441f963b4925a724507079081c10fa46 (diff)
fixed crash on unexpected end of mp3 stream
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index 5c9e1ea3..982daf7c 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -790,6 +790,10 @@ cmp3_stream_frame (mpgmad_info_t *info) {
// read more MPEG data if needed
if(info->stream.buffer==NULL || info->stream.error==MAD_ERROR_BUFLEN) {
// copy part of last frame to beginning
+ if (info->stream.next_frame && info->stream.bufend <= info->stream.next_frame) {
+ eof = 1;
+ break;
+ }
if (info->stream.next_frame != NULL) {
info->buffer.remaining = info->stream.bufend - info->stream.next_frame;
memmove (info->buffer.input, info->stream.next_frame, info->buffer.remaining);
@@ -826,13 +830,14 @@ cmp3_stream_frame (mpgmad_info_t *info) {
{
#if 0
if(info->stream.error!=MAD_ERROR_LOSTSYNC) {
- trace ("mpgmad: recoverable frame level error (%s)\n", MadErrorString(&stream));
+ trace ("mpgmad: recoverable frame level error (%s)\n", MadErrorString(&info->stream));
}
#endif
continue;
}
else {
if(info->stream.error==MAD_ERROR_BUFLEN) {
+// trace ("mpgmad: recoverable frame level error (%s)\n", MadErrorString(&info->stream));
continue;
}
else