#72 Segfault capturing ppm

SVN
closed-fixed
encoding (15)
5
2007-04-19
2007-03-28
Karl H. Beckers
No

./bin/xvidcap --codec ppm
swScaler: bgr32x is not supported as output format
Segmentation fault (core dumped)

Core was generated by `./bin/xvidcap --codec ppm'.
Program terminated with signal 11, Segmentation fault.
#0 sws_scale (c=0x0, src=0xd8f4a0, srcStride=0xd8f4c0, srcSliceY=0, srcSliceH=144, dst=0xcba0a0,
dstStride=0xcba0c0) at swscale.c:2434
2434 if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {
(gdb) bt
#0 sws_scale (c=0x0, src=0xd8f4a0, srcStride=0xd8f4c0, srcSliceY=0, srcSliceH=144, dst=0xcba0a0,
dstStride=0xcba0c0) at swscale.c:2434
#1 0x000000000042e2de in xvc_ffmpeg_save_frame (fp=<value optimized out>, image=0xd87520)
at xtoffmpeg.c:1677
#2 0x000000000041da32 in commonCapture (capfunc=SHM) at capture.c:1139
#3 0x000000000041e1a1 in xvc_capture_shm () at capture.c:1394
#4 0x00000000004226ec in do_record_thread () at gnome_ui.c:513
#5 0x0000003906206305 in start_thread () from /lib64/libpthread.so.0
#6 0x00000039056cd50d in clone () from /lib64/libc.so.6
#7 0x0000000000000000 in ?? ()

Looks like the code issues an error but carries on anyway. It shouldn't segfault as this is bad behaviour. Ideally it should work out the capture capabilities at startup, and exit with a nice error message, but I realise this is harder than it sounds.

Discussion

1 2 > >> (Page 1 of 2)
  • Logged In: YES
    user_id=782084
    Originator: YES

    don't get a segfault here, but a failure and exit, nonetheless.
    It is not related to capture capabilities, but to the capabilities of libswscale (which does not support all the image formats that ffmpeg supports).
    It also affects jpeg.
    The way to go here is to put a check after the automatic computation of the best output pixel format to see whether that format is supported at all. If it is not, we should pick a default (depending on type of capture, prolly yuv420p for mf and rgb24 for sf) which may be more computationally expensive but safe.

     
    • status: open --> open-accepted
     
  • Logged In: YES
    user_id=782084
    Originator: YES

    fix committed to svn.
    this does not fix jpeg, but that seems to be an ffmpeg problem. Checking againt latest version.

     
  • Logged In: YES
    user_id=782084
    Originator: YES

    jpeg problem persists with current ffmpeg. Will escalate upstream and give this some time until I decide what to do (might mean removing jpeg support).

     
  • Logged In: YES
    user_id=782084
    Originator: YES

    jpeg issue due to incorrect use of jpegls codec rather than mjpeg codec.
    Cannot commit that fix to svn right now, because of other changes that would break current svn.
    Also, changing jpegls to mjpeg and fixing colorspace to yuvj422p for jpeg has quality issues which need research.

     
  • Logged In: YES
    user_id=782084
    Originator: YES

    committed

     
    • status: open-accepted --> pending-fixed
     
  • Logged In: YES
    user_id=782084
    Originator: YES

    reverting colorspace to yuvj420p due to problems with mf mjpeg.
    Also equivalent of ffmpeg's -sameq fixes quality issues with both sf jpeg and mf mjpeg.

     
    • status: pending-fixed --> open-fixed
     
  • Logged In: YES
    user_id=782084
    Originator: YES

    fix committed

     
1 2 > >> (Page 1 of 2)