[Mplayer-cvslog] CVS: main/libmpdemux demuxer.c,1.87,1.88 demuxer.h,1.36,1.37
Arpi of Ize
arpi at mplayer.dev.hu
Wed Apr 3 17:40:26 CEST 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv11526
Modified Files:
demuxer.c demuxer.h
Log Message:
don't alloc/free NULL
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- demuxer.c 1 Apr 2002 17:11:59 -0000 1.87
+++ demuxer.c 3 Apr 2002 15:40:13 -0000 1.88
@@ -347,7 +347,7 @@
demux_packet_t *dp=ds->first;
while(dp){
demux_packet_t *dn=dp->next;
- free(dp->buffer);
+ if(dp->buffer) free(dp->buffer);
free(dp);
dp=dn;
}
Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- demuxer.h 27 Mar 2002 12:12:24 -0000 1.36
+++ demuxer.h 3 Apr 2002 15:40:13 -0000 1.37
@@ -118,7 +118,7 @@
inline static demux_packet_t* new_demux_packet(int len){
demux_packet_t* dp=malloc(sizeof(demux_packet_t));
dp->len=len;
- dp->buffer=malloc(len);
+ dp->buffer=len?malloc(len):NULL;
dp->next=NULL;
dp->pts=0;
dp->pos=0;
More information about the MPlayer-cvslog
mailing list