diff options
| author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-11 16:17:11 +0100 |
|---|---|---|
| committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-11 16:17:11 +0100 |
| commit | ce072469888db55316d648918229f2b83fc5e7cf (patch) | |
| tree | 1d995bd3d70d9a9e341cdd894f14e4cb761ead40 /src/libxinevdec | |
| parent | 974c78a88db16711f89f50c8e3f5c98dd4a29c02 (diff) | |
| download | xine-lib-ce072469888db55316d648918229f2b83fc5e7cf.tar.gz xine-lib-ce072469888db55316d648918229f2b83fc5e7cf.tar.bz2 | |
Don't use the if(foo) free(foo); construct, as free(NULL); is well defined.
Diffstat (limited to 'src/libxinevdec')
| -rw-r--r-- | src/libxinevdec/bitplane.c | 38 | ||||
| -rw-r--r-- | src/libxinevdec/foovideo.c | 8 | ||||
| -rw-r--r-- | src/libxinevdec/rgb.c | 8 | ||||
| -rw-r--r-- | src/libxinevdec/yuv.c | 11 |
4 files changed, 14 insertions, 51 deletions
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index b6940813f..a3b18d060 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1186,8 +1186,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen, this->ratio *= 2.0; } - if (this->buf) - free (this->buf); + free (this->buf); this->bufsize = VIDEOBUFSIZE; this->buf = xine_xmalloc(this->bufsize); this->size = 0; @@ -1483,35 +1482,12 @@ static void bitplane_discontinuity (video_decoder_t *this_gen) { static void bitplane_dispose (video_decoder_t *this_gen) { bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } - - if (this->buf_uk) { - free (this->buf_uk); - this->buf_uk = NULL; - } - - if (this->buf_uk_hist) { - free (this->buf_uk_hist); - this->buf_uk_hist = NULL; - } - - if (this->index_buf) { - free (this->index_buf); - this->index_buf = NULL; - } - - if (this->index_buf_hist) { - free (this->index_buf_hist); - this->index_buf_hist = NULL; - } - - if (this->index_buf) { - free (this->index_buf); - this->index_buf = NULL; - } + free (this->buf); + free (this->buf_uk); + free (this->buf_uk_hist); + free (this->index_buf); + free (this->index_buf_hist); + free (this->index_buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 98e0ebc0b..1113f8df0 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -98,8 +98,7 @@ static void foovideo_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */ (this->stream->video_out->open) (this->stream->video_out, this->stream); - if(this->buf) - free(this->buf); + free(this->buf); bih = (xine_bmiheader *) buf->content; this->width = bih->biWidth; @@ -185,10 +184,7 @@ static void foovideo_dispose (video_decoder_t *this_gen) { foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 0e7be4c18..803e4fb3a 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -140,8 +140,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, this->bytes_per_pixel = (this->bit_depth + 1) / 8; - if (this->buf) - free (this->buf); + free (this->buf); /* minimal buffer size */ this->bufsize = this->width * this->height * this->bytes_per_pixel; @@ -381,10 +380,7 @@ static void rgb_discontinuity (video_decoder_t *this_gen) { static void rgb_dispose (video_decoder_t *this_gen) { rgb_decoder_t *this = (rgb_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 2b8657685..456a2cb93 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -104,10 +104,8 @@ static void yuv_decode_data (video_decoder_t *this_gen, this->progressive = buf->decoder_info[3]; this->top_field_first = buf->decoder_info[4]; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); + this->buf = NULL; this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); @@ -304,10 +302,7 @@ static void yuv_discontinuity (video_decoder_t *this_gen) { static void yuv_dispose (video_decoder_t *this_gen) { yuv_decoder_t *this = (yuv_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; |
