[MPlayer-cvslog] r31792 - trunk/spudec.c

reimar subversion at mplayerhq.hu
Sat Jul 24 23:43:29 CEST 2010


Author: reimar
Date: Sat Jul 24 23:43:29 2010
New Revision: 31792

Log:
Remove useless NULL checks before freeing and NULL pointers
to freed memory.

Modified:
   trunk/spudec.c

Modified: trunk/spudec.c
==============================================================================
--- trunk/spudec.c	Sat Jul 24 23:40:06 2010	(r31791)
+++ trunk/spudec.c	Sat Jul 24 23:43:29 2010	(r31792)
@@ -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);
   }
 }


More information about the MPlayer-cvslog mailing list