FreeBSD Bugzilla – Attachment 236103 Details for
Bug 266006
net/linphone: 4.4.8_1 crashes on camera access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add sanity checks to mediastreamer msfilter.c
patch-src-base-msfilter.c (text/plain), 4.09 KB, created by
Ruslan Zalata
on 2022-08-25 01:41:57 UTC
(
hide
)
Description:
Add sanity checks to mediastreamer msfilter.c
Filename:
MIME Type:
Creator:
Ruslan Zalata
Created:
2022-08-25 01:41:57 UTC
Size:
4.09 KB
patch
obsolete
>--- src/base/msfilter.c.orig 2022-08-05 14:45:22.000000000 +0500 >+++ src/base/msfilter.c 2022-08-25 06:21:07.624466000 +0500 >@@ -31,6 +31,7 @@ > #endif > > void ms_filter_register(MSFilterDesc *desc){ >+ ms_return_if_fail(desc!=NULL); > MSFactory *factory = ms_factory_get_fallback(); > if(factory) { > ms_factory_register_filter(factory,desc); >@@ -83,6 +84,7 @@ > } > > bool_t ms_filter_desc_implements_interface(MSFilterDesc *desc, MSFilterInterfaceId id){ >+ ms_return_val_if_fail(desc!=NULL,FALSE); > MSFilterMethod *methods=desc->methods; > if (!methods) return FALSE; > for(;methods->id!=0;methods++){ >@@ -109,15 +111,23 @@ > > > MSFilterId ms_filter_get_id(MSFilter *f){ >+ ms_return_val_if_fail(f!=NULL,-1); >+ ms_return_val_if_fail(f->desc!=NULL,-1); > return f->desc->id; > } > > const char * ms_filter_get_name(MSFilter *f) { >+ ms_return_val_if_fail(f!=NULL,NULL); >+ ms_return_val_if_fail(f->desc!=NULL,NULL); > return f->desc->name; > } > > int ms_filter_link(MSFilter *f1, int pin1, MSFilter *f2, int pin2){ > MSQueue *q; >+ ms_return_val_if_fail(f1!=NULL,-1); >+ ms_return_val_if_fail(f1->desc!=NULL,-1); >+ ms_return_val_if_fail(f2!=NULL,-1); >+ ms_return_val_if_fail(f2->desc!=NULL,-1); > ms_message("ms_filter_link: %s:%p,%i-->%s:%p,%i",f1->desc->name,f1,pin1,f2->desc->name,f2,pin2); > ms_return_val_if_fail(pin1<f1->desc->noutputs, -1); > ms_return_val_if_fail(pin2<f2->desc->ninputs, -1); >@@ -139,6 +149,10 @@ > > int ms_filter_unlink(MSFilter *f1, int pin1, MSFilter *f2, int pin2){ > MSQueue *q; >+ ms_return_val_if_fail(f1!=NULL,-1); >+ ms_return_val_if_fail(f1->desc!=NULL,-1); >+ ms_return_val_if_fail(f2!=NULL,-1); >+ ms_return_val_if_fail(f2->desc!=NULL,-1); > ms_message("ms_filter_unlink: %s:%p,%i-->%s:%p,%i",f1 ? f1->desc->name : "!NULL!",f1,pin1,f2 ? f2->desc->name : "!NULL!",f2,pin2); > ms_return_val_if_fail(pin1<f1->desc->noutputs, -1); > ms_return_val_if_fail(pin2<f2->desc->ninputs, -1); >@@ -198,6 +212,8 @@ > } > > bool_t ms_filter_has_method(MSFilter *f, unsigned int id){ >+ ms_return_val_if_fail(f!=NULL,FALSE); >+ ms_return_val_if_fail(f->desc!=NULL,FALSE); > MSFilterMethod *methods=f->desc->methods; > int i; > for(i=0;methods!=NULL && methods[i].method!=NULL; i++) >@@ -210,6 +226,8 @@ > } > > void ms_filter_destroy(MSFilter *f){ >+ ms_return_if_fail(f!=NULL); >+ ms_return_if_fail(f->desc!=NULL); > if (f->desc->uninit!=NULL) > f->desc->uninit(f); > if (f->inputs!=NULL) ms_free(f->inputs); >@@ -221,6 +239,8 @@ > } > > void ms_filter_process(MSFilter *f){ >+ ms_return_if_fail(f!=NULL); >+ ms_return_if_fail(f->desc!=NULL); > MSTimeSpec start,stop; > uint64_t elapsed_time; > >@@ -239,6 +259,7 @@ > } > > void ms_filter_task_process(MSFilterTask *task){ >+ ms_return_if_fail(task!=NULL); > MSTimeSpec start,stop; > MSFilter *f=task->f; > /*ms_message("Executing task of filter %s:%p",f->desc->name,f);*/ >@@ -257,6 +278,7 @@ > } > > void ms_filter_preprocess(MSFilter *f, struct _MSTicker *t){ >+ ms_return_if_fail(f!=NULL); > f->last_tick=0; > f->ticker=t; > if (f->desc->preprocess!=NULL) >@@ -264,12 +286,16 @@ > } > > void ms_filter_postprocess(MSFilter *f){ >+ ms_return_if_fail(f!=NULL); >+ ms_return_if_fail(f->desc!=NULL); > if (f->desc->postprocess!=NULL) > f->desc->postprocess(f); > f->ticker=NULL; > } > > bool_t ms_filter_inputs_have_data(MSFilter *f){ >+ ms_return_val_if_fail(f!=NULL,FALSE); >+ ms_return_val_if_fail(f->desc!=NULL,FALSE); > int i; > for(i=0;i<f->desc->ninputs;i++){ > MSQueue *q=f->inputs[i]; >@@ -279,6 +305,7 @@ > } > > void ms_filter_postpone_task(MSFilter *f, MSFilterFunc taskfunc){ >+ ms_return_if_fail(f!=NULL); > MSFilterTask *task; > MSTicker *ticker=f->ticker; > if (ticker==NULL){ >@@ -333,6 +360,7 @@ > } > > MSTicker *ms_filter_get_ticker(MSFilter *f){ >+ ms_return_val_if_fail(f!=NULL,NULL); > return f->ticker; > } > >@@ -342,6 +370,7 @@ > } > > int ms_connection_helper_link(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin){ >+ ms_return_val_if_fail(h!=NULL,-1); > int err=0; > if (h->last.filter==NULL){ > h->last.filter=f; >@@ -357,6 +386,7 @@ > } > > int ms_connection_helper_unlink(MSConnectionHelper *h, MSFilter *f, int inpin, int outpin){ >+ ms_return_val_if_fail(h!=NULL,-1); > int err=0; > if (h->last.filter==NULL){ > h->last.filter=f;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 266006
:
236088
|
236102
| 236103