After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723615 - SIGSEGV when setting preload option in gst_ffmpegmux_setcaps
SIGSEGV when setting preload option in gst_ffmpegmux_setcaps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other All
: Normal critical
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-04 16:03 UTC by Dmitry
Modified: 2014-02-04 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix with corrected address passing (960 bytes, patch)
2014-02-04 16:16 UTC, Dmitry
committed Details | Review

Description Dmitry 2014-02-04 16:03:09 UTC
Trying to encode video using libav through gst-libav I faced following problem:

  • #0 strcmp
    at strcmp.c line 38
  • #1 av_opt_find2
    at libavutil/opt.c line 663
  • #2 set_number
    at libavutil/opt.c line 253
  • #3 av_opt_set_int
    at libavutil/opt.c line 264
  • #4 gst_ffmpegmux_setcaps
    at gstavmux.c line 477
  • #5 gst_ffmpegmux_sink_event
    at gstavmux.c line 520
  • #6 gst_pad_send_event_unchecked
    at gstpad.c line 4986


Problem is: code tryes to access field name on object o of type AVOption when o is invalid.
After investigation I found that problem is cast of method param obj to type AVClass:
const AVClass  *c = *(AVClass**)obj;

AVFormatContext struct contains field av_class of type AVClass* which is 1st field, so change of code from:
    av_opt_set_int(&ffmpegmux->context, "preload", ffmpegmux->preload, 0);
to
    av_opt_set_int(&ffmpegmux->context->av_class, "preload", ffmpegmux->preload, 0); // more readable
or
    av_opt_set_int(ffmpegmux->context, "preload", ffmpegmux->preload, 0); // corrects address passing
fixes my problem.
Comment 1 Sebastian Dröge (slomo) 2014-02-04 16:06:41 UTC
Can you provide a patch in "git format-patch" format, including your real name and mail address?
Comment 2 Dmitry 2014-02-04 16:16:22 UTC
Created attachment 268079 [details] [review]
Fix with corrected address passing

I attached patch with second variant of fix inside
Comment 3 Sebastian Dröge (slomo) 2014-02-04 16:29:20 UTC
commit fe224775cfa13b442d73ab76e7b2d5cdd491ef75
Author: Dmitry Melnichenko <dmitry.m@samsung.com>
Date:   Tue Feb 4 18:17:32 2014 +0200

    avmux: Fix invalid address passing to av_opt_set_int()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723615