Mercurial > mplayer.hg
comparison libmpcodecs/vf_screenshot.c @ 32537:8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
author | cboesch |
---|---|
date | Sun, 14 Nov 2010 09:12:34 +0000 |
parents | 92f88bb315c5 |
children | f3d53cd55376 |
comparison
equal
deleted
inserted
replaced
32536:187f26cba0ce | 32537:8fa2f43cb760 |
---|---|
73 vf->priv->avctx->compression_level = 0; | 73 vf->priv->avctx->compression_level = 0; |
74 vf->priv->dw = d_width; | 74 vf->priv->dw = d_width; |
75 vf->priv->dh = d_height; | 75 vf->priv->dh = d_height; |
76 vf->priv->stride = (3*vf->priv->dw+15)&~15; | 76 vf->priv->stride = (3*vf->priv->dw+15)&~15; |
77 | 77 |
78 if (vf->priv->buffer) free(vf->priv->buffer); // probably reconfigured | 78 free(vf->priv->buffer); // probably reconfigured |
79 vf->priv->buffer = NULL; | 79 vf->priv->buffer = NULL; |
80 | 80 |
81 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); | 81 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
82 } | 82 } |
83 | 83 |
276 static void uninit(vf_instance_t *vf) | 276 static void uninit(vf_instance_t *vf) |
277 { | 277 { |
278 avcodec_close(vf->priv->avctx); | 278 avcodec_close(vf->priv->avctx); |
279 av_freep(&vf->priv->avctx); | 279 av_freep(&vf->priv->avctx); |
280 if(vf->priv->ctx) sws_freeContext(vf->priv->ctx); | 280 if(vf->priv->ctx) sws_freeContext(vf->priv->ctx); |
281 if (vf->priv->buffer) av_free(vf->priv->buffer); | 281 av_free(vf->priv->buffer); |
282 free(vf->priv->outbuffer); | 282 free(vf->priv->outbuffer); |
283 free(vf->priv); | 283 free(vf->priv); |
284 } | 284 } |
285 | 285 |
286 static int vf_open(vf_instance_t *vf, char *args) | 286 static int vf_open(vf_instance_t *vf, char *args) |