1
mirror of https://github.com/mpv-player/mpv synced 2024-09-09 01:16:56 +02:00

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
This commit is contained in:
reimar 2012-10-30 18:53:58 +00:00 committed by wm4
parent 5d44d445ef
commit 78899a096f

View File

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