mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +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:
parent
5d44d445ef
commit
78899a096f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user