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
This commit is contained in:
reimar 2010-07-24 21:43:29 +00:00 committed by Uoti Urpala
parent a5e9d3b56a
commit 37097806be
1 changed files with 9 additions and 6 deletions

View File

@ -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);
}
}