GNOME Bugzilla – Bug 723615
SIGSEGV when setting preload option in gst_ffmpegmux_setcaps
Last modified: 2014-02-04 16:29:32 UTC
Trying to encode video using libav through gst-libav I faced following problem:
+ Trace 233129
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.
Can you provide a patch in "git format-patch" format, including your real name and mail address?
Created attachment 268079 [details] [review] Fix with corrected address passing I attached patch with second variant of fix inside
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