bug#28289 & bug#28667. memleaks on gifdecoder and strdups. r:dp, danm a:jar
git-svn-id: svn://10.0.0.236/trunk@61472 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
64fa1b6c33
commit
b4d09c5c0a
@ -709,8 +709,7 @@ gif_delay_time_callback(void *closure)
|
||||
gs->delay_timeout = NULL;
|
||||
|
||||
if(gs->ic){
|
||||
if(gs->ic->type != NULL)
|
||||
nsCRT::free(gs->ic->type);
|
||||
if(gs->ic->type == NULL)
|
||||
gs->ic->type = nsCRT::strdup("image/gif"); //mime string
|
||||
}
|
||||
else
|
||||
|
||||
@ -1072,18 +1072,24 @@ IL_StreamFirstWrite(il_container *ic, const unsigned char *str, int32 len)
|
||||
|
||||
/* we did our best. Gotta give up. */
|
||||
if (NS_FAILED(rv)){
|
||||
return MK_IMAGE_LOSSAGE;
|
||||
|
||||
return MK_IMAGE_LOSSAGE;
|
||||
}
|
||||
|
||||
imgdec->SetContainer(ic);
|
||||
// We will already have a decoder instance for this
|
||||
// image container if the image is animated. For now,
|
||||
// we release it before taking the new one.
|
||||
// Later I'll see how animated image containers can
|
||||
// reuse the decoder for subsequent frames.
|
||||
if(ic->imgdec)
|
||||
NS_RELEASE(ic->imgdec);
|
||||
ic->imgdec = imgdec;
|
||||
|
||||
rv = imgdec->ImgDInit();
|
||||
|
||||
if(NS_FAILED(rv)){
|
||||
NS_RELEASE(ic->imgdec);
|
||||
ic->imgdec = nsnull; //ptn add il_delete_container()
|
||||
NS_RELEASE(ic->imgdec);
|
||||
ic->imgdec = nsnull;
|
||||
ILTRACE(0,("il: image init failed"));
|
||||
return MK_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -647,6 +647,7 @@ il_delete_container(il_container *ic)
|
||||
|
||||
FREE_IF_NOT_NULL(ic->comment);
|
||||
nsCRT::free(ic->url_address);
|
||||
nsCRT::free(ic->type);
|
||||
FREE_IF_NOT_NULL(ic->fetch_url);
|
||||
|
||||
PR_FREEIF(ic);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user