Ticket #4837: libs_libmythtv_osdchromakey.cpp-move-up-null-check.patch
File libs_libmythtv_osdchromakey.cpp-move-up-null-check.patch, 2.0 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/osdchromakey.cpp
From: Erik Hovland <erik@hovland.org> --- libs/libmythtv/osdchromakey.cpp | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libs/libmythtv/osdchromakey.cpp b/libs/libmythtv/osdchromakey.cpp index 07bc2e2..ed7e8f2 100644
a b void ChromaKeyOSD::AllocImage(int i) 32 32 &shm_infos[i], 33 33 videoOutput->display_visible_rect.width(), 34 34 videoOutput->display_visible_rect.height()); 35 if (!shm_img) 36 return; 37 35 38 uint size = shm_img->bytes_per_line * (shm_img->height+1) + 128; 36 39 X11U; 37 40 38 if (shm_img) 41 shm_infos[i].shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); 42 if (shm_infos[i].shmid >= 0) 39 43 { 40 shm_infos[i].shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); 41 if (shm_infos[i].shmid >= 0) 42 { 43 shm_infos[i].shmaddr = (char*) shmat(shm_infos[i].shmid, 0, 0); 44 45 shm_img->data = shm_infos[i].shmaddr; 46 shm_infos[i].readOnly = False; 47 48 X11L; 49 XShmAttach(videoOutput->XJ_disp, &shm_infos[i]); 50 XSync(videoOutput->XJ_disp, False); // needed for FreeBSD? 51 X11U; 52 53 // Mark for delete immediately. 54 // It won't actually be removed until after we detach it. 55 shmctl(shm_infos[i].shmid, IPC_RMID, 0); 56 } 44 shm_infos[i].shmaddr = (char*) shmat(shm_infos[i].shmid, 0, 0); 45 46 shm_img->data = shm_infos[i].shmaddr; 47 shm_infos[i].readOnly = False; 48 49 X11L; 50 XShmAttach(videoOutput->XJ_disp, &shm_infos[i]); 51 XSync(videoOutput->XJ_disp, False); // needed for FreeBSD? 52 X11U; 53 54 // Mark for delete immediately. 55 // It won't actually be removed until after we detach it. 56 shmctl(shm_infos[i].shmid, IPC_RMID, 0); 57 57 } 58 58 59 59 img[i] = shm_img;