提交 13c0b600 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #395 in FS/freeswitch from ~BRADLEYJOKINEN/freeswitch:FS-7970 to master

* commit 'd6e5dc64':
  FS-7970 Fixed crash in video_bug_thread caused by double free
...@@ -565,6 +565,9 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void * ...@@ -565,6 +565,9 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void *
img = (switch_image_t *) pop; img = (switch_image_t *) pop;
w = img->d_w;
h = img->d_h;
if (other_q) { if (other_q) {
while(switch_queue_size(other_q) > 0) { while(switch_queue_size(other_q) > 0) {
if ((status = switch_queue_trypop(other_q, &pop)) == SWITCH_STATUS_SUCCESS) { if ((status = switch_queue_trypop(other_q, &pop)) == SWITCH_STATUS_SUCCESS) {
...@@ -574,12 +577,7 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void * ...@@ -574,12 +577,7 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void *
} }
} }
} }
}
w = img->d_w;
h = img->d_h;
if (other_q) {
if (other_img) { if (other_img) {
if (other_img->d_w != w || other_img->d_h != h) { if (other_img->d_w != w || other_img->d_h != h) {
switch_image_t *tmp_img = NULL; switch_image_t *tmp_img = NULL;
...@@ -602,14 +600,11 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void * ...@@ -602,14 +600,11 @@ static void *SWITCH_THREAD_FUNC video_bug_thread(switch_thread_t *thread, void *
if (other_img) { if (other_img) {
switch_img_patch(IMG, other_img, w / 2, 0); switch_img_patch(IMG, other_img, w / 2, 0);
} }
} else {
IMG = img;
} }
switch_thread_rwlock_rdlock(bug->session->bug_rwlock); switch_thread_rwlock_rdlock(bug->session->bug_rwlock);
//switch_mutex_lock(bug->read_mutex); //switch_mutex_lock(bug->read_mutex);
frame.img = IMG; frame.img = other_q ? IMG : img;
bug->ping_frame = &frame; bug->ping_frame = &frame;
if (bug->callback) { if (bug->callback) {
if (bug->callback(bug, bug->user_data, SWITCH_ABC_TYPE_STREAM_VIDEO_PING) == SWITCH_FALSE if (bug->callback(bug, bug->user_data, SWITCH_ABC_TYPE_STREAM_VIDEO_PING) == SWITCH_FALSE
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论