summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2012-10-30 18:53:58 +0000
committerwm4 <wm4@nowhere>2012-10-31 22:43:26 +0100
commit78899a096f7777094516d3a0e323b2fe2315ae3c (patch)
tree8ecfa3881c595c5ff5f56ba2e3e8cb0c6bc25b4f /sub
parent5d44d445ef2b13c0a44c49823fc74c97022e47be (diff)
downloadmpv-78899a096f7777094516d3a0e323b2fe2315ae3c.tar.bz2
mpv-78899a096f7777094516d3a0e323b2fe2315ae3c.tar.xz
spudec: set pointers to NULL after free
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35303 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'sub')
-rw-r--r--sub/spudec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sub/spudec.c b/sub/spudec.c
index 47e1676e2e..431a161e9d 100644
--- a/sub/spudec.c
+++ b/sub/spudec.c
@@ -228,7 +228,9 @@ static int spudec_alloc_image(spudec_handle_t *this, int stride, int height)
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;
}