GNOME Bugzilla – Bug 161667
[PATCH][snapshot] seg fault in signal handler
Last modified: 2005-01-09 01:43:55 UTC
TO REPRODUCE: $ gst-launch-0.8 videotestsrc num-buffers=10 ! snapshot frame=5 location=z.png ! fakesink RUNNING pipeline ... Segmentation fault EXPECTED BEHAVIOR: A PNG snapshot of the test pattern appears in new file z.png ACTUAL BEHAVIOR: z.png is 0 bytes long, and gst-launch crashes with a seg fault. SOURCE OF PROBLEM: Looks like a stray signal handler: The snapshot_handler function was setting a flag to TRUE, so the gstsnapshot_chain function was trying to write the PNG image twice. After the first attempt, the PNG library structures are destroyed, so the second attempt seg faults. About to attach a patch...
Created attachment 34986 [details] [review] Patch that removes snapshot_handler function. Eliminates the snapshot_handler function. The only thing that function did was set the snapshot_asked flag to TRUE, which was causing the seg fault.
applied.
Created attachment 35516 [details] [review] different patch (against head) * removes recursive behaviour through the snapshot signal * keeps signal usable for apps * png structs are created where used ( and freed )
Hm, ok, reopening so I can apply agian.
Created attachment 35624 [details] [review] proposed patch Same patch as before, but fix caps to RGB instead of BGR.
applied again, thanks.