[MPlayer-cvslog] r35303 - trunk/sub/spudec.c

reimar subversion at mplayerhq.hu
Tue Oct 30 19:53:58 CET 2012


Author: reimar
Date: Tue Oct 30 19:53:58 2012
New Revision: 35303

Log:
Set pointers to NULL after free.
For the pal_image one it would have been possible
to leak the old pointer of the malloc for "image" failed.

Modified:
   trunk/sub/spudec.c

Modified: trunk/sub/spudec.c
==============================================================================
--- trunk/sub/spudec.c	Tue Oct 30 19:37:37 2012	(r35302)
+++ trunk/sub/spudec.c	Tue Oct 30 19:53:58 2012	(r35303)
@@ -227,7 +227,9 @@ static int spudec_alloc_image(spudec_han
   if (this->image_size < this->stride * this->height) {
     if (this->image != NULL) {
       free(this->image);
+      this->image = NULL;
       free(this->pal_image);
+      this->pal_image = NULL;
       this->image_size = 0;
       this->pal_width = this->pal_height  = 0;
     }


More information about the MPlayer-cvslog mailing list