]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1294504: make sure to check for NULL frame
authorMichael Jerris <mike@jerris.com>
Wed, 22 Apr 2015 15:28:52 +0000 (10:28 -0500)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:24 +0000 (12:47 -0500)
src/switch_core_media.c

index c8b89224b49d760013fdb1c9f5eabfc03f3aeaec..f475da1a04fab859582148f8d506d87a5f053409 100644 (file)
@@ -10451,14 +10451,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
                        }
 
                        if (bp->ready && switch_test_flag(bp, SMBF_READ_VIDEO_STREAM)) {
-                               if ((*frame)->img) {
+                               if ((*frame) && (*frame)->img) {
                                        switch_image_t *img = NULL;
                                        switch_img_copy((*frame)->img, &img);
                                        switch_queue_push(bp->read_video_queue, img);
                                }
                        }
 
-                       if (bp->ready && (*frame)->img && switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
+                       if (bp->ready && (*frame) && (*frame)->img && switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
                                bp->ping_frame = *frame;
                                if (bp->callback) {
                                        if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_VIDEO_PING) == SWITCH_FALSE