diff options
Diffstat (limited to 'multimedia/mplayer-share/patches/patch-aj')
-rw-r--r-- | multimedia/mplayer-share/patches/patch-aj | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/multimedia/mplayer-share/patches/patch-aj b/multimedia/mplayer-share/patches/patch-aj new file mode 100644 index 00000000000..1f27d4ed9be --- /dev/null +++ b/multimedia/mplayer-share/patches/patch-aj @@ -0,0 +1,39 @@ +$NetBSD: patch-aj,v 1.1 2006/04/13 14:05:34 drochner Exp $ + +--- libmpdemux/demuxer.h.orig 2005-04-03 16:08:26.000000000 +0200 ++++ libmpdemux/demuxer.h +@@ -155,17 +155,19 @@ inline static demux_packet_t* new_demux_ + dp->flags=0; + dp->refcount=1; + dp->master=NULL; +- dp->buffer=len?(unsigned char*)malloc(len+8):NULL; +- if(len) memset(dp->buffer+len,0,8); ++ dp->buffer=NULL; ++ if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + 8))) ++ memset(dp->buffer + len, 0, 8); ++ else ++ dp->len = 0; + return dp; + } + + inline static void resize_demux_packet(demux_packet_t* dp, int len) + { +- if(len) ++ if(len > 0) + { + dp->buffer=(unsigned char *)realloc(dp->buffer,len+8); +- memset(dp->buffer+len,0,8); + } + else + { +@@ -173,6 +175,10 @@ inline static void resize_demux_packet(d + dp->buffer=NULL; + } + dp->len=len; ++ if (dp->buffer) ++ memset(dp->buffer + len, 0, 8); ++ else ++ dp->len = 0; + } + + inline static demux_packet_t* clone_demux_packet(demux_packet_t* pack){ |