mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-08 16:54:03 +02:00
Drop unneeded checks before av_free() and change to av_freep() where it's more suitable.
Originally committed as revision 6212 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
767516533d
commit
34a8dcd031
@ -395,10 +395,8 @@ static int decode_end(AVCodecContext * avctx)
|
|||||||
{
|
{
|
||||||
KmvcContext *const c = (KmvcContext *) avctx->priv_data;
|
KmvcContext *const c = (KmvcContext *) avctx->priv_data;
|
||||||
|
|
||||||
if (c->frm0)
|
av_freep(&c->frm0);
|
||||||
av_free(c->frm0);
|
av_freep(&c->frm1);
|
||||||
if (c->frm1)
|
|
||||||
av_free(c->frm1);
|
|
||||||
if (c->pic.data[0])
|
if (c->pic.data[0])
|
||||||
avctx->release_buffer(avctx, &c->pic);
|
avctx->release_buffer(avctx, &c->pic);
|
||||||
|
|
||||||
|
@ -550,14 +550,10 @@ static int decode_end(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
|
SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
|
||||||
|
|
||||||
if(smk->mmap_tbl)
|
av_freep(&smk->mmap_tbl);
|
||||||
av_free(smk->mmap_tbl);
|
av_freep(&smk->mclr_tbl);
|
||||||
if(smk->mclr_tbl)
|
av_freep(&smk->full_tbl);
|
||||||
av_free(smk->mclr_tbl);
|
av_freep(&smk->type_tbl);
|
||||||
if(smk->full_tbl)
|
|
||||||
av_free(smk->full_tbl);
|
|
||||||
if(smk->type_tbl)
|
|
||||||
av_free(smk->type_tbl);
|
|
||||||
|
|
||||||
if (smk->pic.data[0])
|
if (smk->pic.data[0])
|
||||||
avctx->release_buffer(avctx, &smk->pic);
|
avctx->release_buffer(avctx, &smk->pic);
|
||||||
|
@ -4165,18 +4165,18 @@ static int vc1_decode_frame(AVCodecContext *avctx,
|
|||||||
// do parse frame header
|
// do parse frame header
|
||||||
if(v->profile < PROFILE_ADVANCED) {
|
if(v->profile < PROFILE_ADVANCED) {
|
||||||
if(vc1_parse_frame_header(v, &s->gb) == -1) {
|
if(vc1_parse_frame_header(v, &s->gb) == -1) {
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(vc1_parse_frame_header_adv(v, &s->gb) == -1) {
|
if(vc1_parse_frame_header_adv(v, &s->gb) == -1) {
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s->pict_type != I_TYPE && !v->res_rtm_flag){
|
if(s->pict_type != I_TYPE && !v->res_rtm_flag){
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4186,7 +4186,7 @@ static int vc1_decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
/* skip B-frames if we don't have reference frames */
|
/* skip B-frames if we don't have reference frames */
|
||||||
if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)){
|
if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)){
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;//buf_size;
|
return -1;//buf_size;
|
||||||
}
|
}
|
||||||
/* skip b frames if we are in a hurry */
|
/* skip b frames if we are in a hurry */
|
||||||
@ -4194,12 +4194,12 @@ static int vc1_decode_frame(AVCodecContext *avctx,
|
|||||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
|
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
|
||||||
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
|
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
|
||||||
|| avctx->skip_frame >= AVDISCARD_ALL) {
|
|| avctx->skip_frame >= AVDISCARD_ALL) {
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
/* skip everything if we are in a hurry>=5 */
|
/* skip everything if we are in a hurry>=5 */
|
||||||
if(avctx->hurry_up>=5) {
|
if(avctx->hurry_up>=5) {
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;//buf_size;
|
return -1;//buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4211,7 +4211,7 @@ static int vc1_decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(MPV_frame_start(s, avctx) < 0) {
|
if(MPV_frame_start(s, avctx) < 0) {
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4243,7 +4243,7 @@ assert(s->current_picture.pict_type == s->pict_type);
|
|||||||
/* we substract 1 because it is added on utils.c */
|
/* we substract 1 because it is added on utils.c */
|
||||||
avctx->frame_number = s->picture_number - 1;
|
avctx->frame_number = s->picture_number - 1;
|
||||||
|
|
||||||
if(buf2)av_free(buf2);
|
av_free(buf2);
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,10 +671,8 @@ static int decode_end(AVCodecContext *avctx)
|
|||||||
#ifdef CONFIG_ZLIB
|
#ifdef CONFIG_ZLIB
|
||||||
inflateEnd(&(c->zstream));
|
inflateEnd(&(c->zstream));
|
||||||
#endif
|
#endif
|
||||||
if(c->cur)
|
av_freep(&c->cur);
|
||||||
av_freep(&c->cur);
|
av_freep(&c->prev);
|
||||||
if(c->prev)
|
|
||||||
av_freep(&c->prev);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user