openbsd-ports/audio/libmodplug/patches/patch-src_load_abc_cpp

22 lines
627 B
Plaintext

$OpenBSD: patch-src_load_abc_cpp,v 1.1 2011/05/05 21:25:48 jasper Exp $
Prevent abc_remove_unnecessary_events() from removing the last track.
From upstream git: d7c36959757fc6c8e4d487be8a72383093d9d26f
--- src/load_abc.cpp.orig Fri Mar 25 23:02:07 2011
+++ src/load_abc.cpp Thu May 5 23:20:40 2011
@@ -1022,10 +1022,12 @@ static void abc_remove_unnecessary_events(ABCHANDLE *h
_mm_free(h->trackhandle,tp);
tp = ptp;
}
- else {
+ else if (tp->next) {
h->track = tp->next;
_mm_free(h->trackhandle,tp);
tp = h->track;
+ } else {
+ break;
}
}
ptp = tp; // remember previous track