Motion - Bug Report 2007x 03x 30x 175913

BUG: Segmentation fault at video_common.c:830

The svn revision r174 of motion crashes at the start all the time with the SN9C102 camera.
Core was generated by `./motion'.
Program terminated with signal 11, Segmentation fault.
#0  0x08055b18 in vid_next (cnt=0x807b018, 
    map=0xb6ea3008 '&#65533;' <repeats 200 times>...) at video_common.c:830
830                     if (--viddevs[i]->frames <= 0) {
(gdb) bt
#0  0x08055b18 in vid_next (cnt=0x807b018, 
    map=0xb6ea3008 '&#65533;' <repeats 200 times>...) at video_common.c:830
#1  0x0804b1e6 in motion_init (cnt=0x807b018) at motion.c:495
#2  0x0804b73d in motion_loop (arg=0x807b018) at motion.c:680
#3  0x440872db in start_thread (arg=0xb7f77b90) at pthread_create.c:296
#4  0x43fb56fe in clone () from /lib/libc.so.6
(gdb) 

The following patch fixes the problem:
Index: motion-3.2.8/motion.c
===================================================================
--- motion-3.2.8/motion.c   (revision 174)
+++ motion-3.2.8/motion.c   (working copy)
@@ -474,8 +474,8 @@
    cnt->imgs.shotstamp = mymalloc(sizeof(int));
 
    /* Allocate a buffer for temp. usage in some places */
-   /* Only despeckle for now... */
-   cnt->imgs.common_buffer = mymalloc(3 * cnt->imgs.width);
+   /* Only despeckle & bayer2rgb24() for now... */
+   cnt->imgs.common_buffer = mymalloc(3 * cnt->imgs.width * cnt->imgs.height);
 
    /* Now is a good time to init rotation data. Since vid_start has been
     * called, we know that we have imgs.width and imgs.height. When capturing




Environment

Motion version: 3.2.8
ffmpeg version:  
Shared libraries:  
Server OS: Fedora Development, kernel 2.6.21-rc4n

-- DamianWrobel - 30 Mar 2007

Follow up

Fix record

Added to last svn revision, sorry i introduced on latest commit. Thanks smile

-- AngelCarpintero - 31 Mar 2007

BugReportForm edit

TopicTitle Segmentation fault at video_common.c:830
BugStatus Released
AssignedBugTo Angel.Carpintero
SubmittedBy DamianWrobel
Topic revision: r4 - 21 Feb 2008, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.