summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-24 21:43:29 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:45 +0200
commit37097806be4e4874df4062c2d02c0868d437cf58 (patch)
tree1f692f6c08beec01c760d24c907a0736591d9757 /spudec.c
parenta5e9d3b56a82c2a2e1508f437a4890f6e4a1fc5c (diff)
downloadmpv-37097806be4e4874df4062c2d02c0868d437cf58.tar.bz2
mpv-37097806be4e4874df4062c2d02c0868d437cf58.tar.xz
spudec.c: Remove useless NULL checks before free()
Also set pointers to NULL after freeing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31792 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/spudec.c b/spudec.c
index da665a8ddf..500a133e4a 100644
--- a/spudec.c
+++ b/spudec.c
@@ -1265,13 +1265,16 @@ void spudec_free(void *this)
if (spu) {
while (spu->queue_head)
spudec_free_packet(spudec_dequeue_packet(spu));
- if (spu->packet)
- free(spu->packet);
- if (spu->scaled_image)
- free(spu->scaled_image);
- if (spu->image)
- free(spu->image);
+ free(spu->packet);
+ spu->packet = NULL;
+ free(spu->scaled_image);
+ spu->scaled_image = NULL;
+ free(spu->image);
+ spu->image = NULL;
+ spu->aimage = NULL;
free(spu->pal_image);
+ spu->pal_image = NULL;
+ spu->image_size = 0;
free(spu);
}
}