mirror of
https://github.com/mpv-player/mpv
synced 2025-03-01 03:40:43 +00:00
don't alloc/free NULL
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5470 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
3909deefdb
commit
85f68b48b8
@ -347,7 +347,7 @@ void ds_free_packs(demux_stream_t *ds){
|
||||
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;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ typedef struct demuxer_st {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user