summaryrefslogtreecommitdiff
path: root/ffserver.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '122de16dd8108a59a55d30543c9f28b5f61b02d1'Clément Bœsch2017-05-051-1/+1
|\ | | | | | | | | | | | | * commit '122de16dd8108a59a55d30543c9f28b5f61b02d1': Replace cmdutils_common_opts.h by a macro Merged-by: Clément Bœsch <cboesch@gopro.com>
* | ffserver: local OOB write with custom program nameTobias Stoeckmann2017-01-081-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the command line for children is created, it is assumed that my_program_name always ends with "ffserver", which doesn't have to be true if ffserver is called through a symbolic link. In such a case, it could be that not enough space for "ffmpeg" is available at the end, leading to a buffer overflow. One example would be: $ ln -s /usr/bin/ffserver ~/f; ~/f As this is only a local buffer overflow, i.e. is based on a weird program call, this has NO security impact. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Check chunk sizeMichael Niedermayer2016-12-051-1/+4
| | | | | | | | | | | | | | | | Fixes out of array access Fixes: poc_ffserver.py Found-by: Paul Cher <paulcher@icloud.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: remove one avcodec_context_copy()Michael Niedermayer2016-12-031-1/+2
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: set format bitexact flag, eliminate warnings about it not being setMichael Niedermayer2016-12-011-0/+3
| | | | | | | | | | | | Tested-by: Reto Kromer <lists@reto.ch> Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: fix broken HTML on generated status pageReynaldo H. Verdejo Pinochet2016-11-301-14/+13
| | | | | | | | | | | | Dropped incompatible/obsoleted HTML tag attributes Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: use codec time_base for streamAndreas Cadhalpun2016-11-301-1/+1
| | | | | | | | | | | | | | This fixes producing swf and rm files as done by ffservertest. Reviewed-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffserver: Add client requested urls to the status pageMichael Niedermayer2016-11-301-3/+35
| | | | | | | | | | | | | | Fixes Ticket3791 Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffsrever: Make the status page bitexact if any stream is bitexactMichael Niedermayer2016-11-291-5/+9
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Remove last use of AVStream sizeMichael Niedermayer2016-11-281-14/+4
| | | | | | | | | | Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Remove some deprecated API use related to codec/codecparMichael Niedermayer2016-11-281-7/+1
| | | | | | | | | | Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Remove use of AVStream as a intermediate to store parametersMichael Niedermayer2016-11-281-37/+54
| | | | | | | | | | Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: drop FeedData, its unusedMichael Niedermayer2016-11-281-6/+0
| | | | | | | | | | Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Remove extract_mpeg4_header()Michael Niedermayer2016-11-271-52/+0
| | | | | | | | | | | | | | | | This should not be needed, our AVParsers should do this I do not have a testcase though, please help testing this and please add fate tests if you can. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Revert "ffserver: use AVStream.codecpar in open_input_stream()"Michael Niedermayer2016-11-271-1/+1
| | | | | | | | | | | | | | | | Fixes null pointer dereference Testcase is simply a ffmpeg instance sending a stream to ffserver while another ffmpeg reads from it This reverts commit 6f0a1710d77dde0d803861506a2157a23f08c14c.
* | ffserver: use AVStream.codecpar in open_input_stream()Reynaldo H. Verdejo Pinochet2016-11-081-1/+1
| | | | | | | | | | | | | | AVStream.codec is deprecated Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: user AVStream.codecpar in compute_status()Reynaldo H. Verdejo Pinochet2016-11-081-7/+7
| | | | | | | | | | | | | | AVStream.codec is deprecated Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: use AVStream.codecpar in find_stream_in_feed()Reynaldo H. Verdejo Pinochet2016-11-081-3/+3
| | | | | | | | | | | | | | AVStream.codec is deprecated Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: get time_base from AVStream in print_stream_params()Reynaldo H. Verdejo Pinochet2016-11-081-2/+2
| | | | | | | | | | | | | | AVStream.codec is deprecated Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: use .codecpar instead of .codec in print_stream_params()Reynaldo H. Verdejo Pinochet2016-11-081-5/+5
| | | | | | | | | | | | | | AVStream.codec is deprecated Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: check for codec match using AVStream.codecparReynaldo H. Verdejo Pinochet2016-11-081-12/+11
| | | | | | | | | | | | | | | | Compare using AVCodecParameters instead of the deprecated AVStream.codec field Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Fix one AVFormatContext misuseMichael Niedermayer2016-11-071-34/+34
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: steal SPACE_CHARS, remove one reason for internal.h that wayMichael Niedermayer2016-11-071-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: eliminate hardcoded literal and duplicated array sizeMichael Niedermayer2016-11-071-2/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: use av_freep() for a case that is not clearly at the end of a functionMichael Niedermayer2016-11-071-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Throw ffm.h out its not used except for a constant that is part of ↵Michael Niedermayer2016-11-071-1/+0
| | | | | | | | | | | | the format Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: drop a bunch of apparently unneeded internal headersMichael Niedermayer2016-11-071-5/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | cmdutils: remove the current working directory from the DLL search path on win32Hendrik Leppkes2016-08-081-0/+1
| | | | | | | | | | Reviewed-by: Matt Oliver <protogonoi@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: fixed deallocation bug in build_feed_streamsGregor Riepl2016-05-271-0/+2
| | | | | | | | | | Signed-off-by: Gregor Riepl <onitake@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-0/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | ffserver: Fixed ffserver to support large ffm filesLior Mualem2016-03-081-4/+5
| | | | | | | | | | | | ffm_read_write_index returns a 64bit value, Github: Closes #185
* | ffserver&ffm: Fixed issues preventing ffserver write_index and files_size ↵Oliver Collyer2016-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | from being set correctly which was breaking ffserver streaming. I discovered that ffserver streaming was broken (it seems like it has been since 20th November) and I opened a ticket for this (https://trac.ffmpeg.org/ticket/5250 <https://trac.ffmpeg.org/ticket/5250>). I spent yesterday learning git bisect (with the kind help of cehoyos) to painstakingly track down the cause. This was made more difficult due to the presence of a segfault in ffserver during the period where the bug was introduced so I first had to identify when and how that was fixed and then retrospectively apply that fix again for each step of the second git bisect to find the actual bug. Anyway, the fruits of my labour are the innocent looking patch below to correct a couple of typos and define a valid range for two variables. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Cast time_t value when using it in a format string.Carl Eugen Hoyos2015-12-291-1/+1
| | | | | | | | Fixes ticket #5103.
* | ffserver: add a doctype heading to our HTML pagesReynaldo H. Verdejo Pinochet2015-12-271-0/+4
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: HTML encode msgs instead of blindly stripping chars outReynaldo H. Verdejo Pinochet2015-12-271-8/+81
| | | | | | | | | | | | | | | | | | Fixes weirdness like our "??filename? not found" 404. None of the chars being used from the previously blacklisted list needs to be scaped on an UTF-8 document context Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: make our 404 explicitly HTML5/UTF-8Reynaldo H. Verdejo Pinochet2015-12-271-1/+5
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: refactor build_feed_streams()Reynaldo H. Verdejo Pinochet2015-12-191-74/+98
| | | | | | | | | | | | | | | | | | | | * Avoid excesive nesting that made it really hard to follow * Drop unneeded vars * Factor out codec compatibility check routine * Ensure inputs are closed and contexts are freed as needed before returning Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: refactor build_file_streams()Reynaldo H. Verdejo Pinochet2015-12-191-41/+44
| | | | | | | | | | | | Avoid unneeded nesting, drop redundant var Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: unify exit path from build_feed_streams()Reynaldo H. Verdejo Pinochet2015-12-191-17/+29
| | | | | | | | | | | | | | Exit from main on build_feed_streams() failures & use standard EXIT_ codes on error out/normal exit. Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: explicitly use time_t for uptime calcReynaldo H. Verdejo Pinochet2015-12-151-2/+4
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: free pathname before bailing outReynaldo H. Verdejo Pinochet2015-12-151-0/+1
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: use EXIT_FAILURE on failed child fork()Reynaldo H. Verdejo Pinochet2015-12-151-1/+1
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: be explicit on failed fork() msgReynaldo H. Verdejo Pinochet2015-12-151-1/+1
| | | | | | | | Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: allocate AVStream's internal tooReynaldo H. Verdejo Pinochet2015-12-151-0/+2
| | | | | | | | | | | | | | | | | | | | Avoids segfault at init_muxer() (mux.c) due to a null pointer dereference on the recently introduced AVStream->internal Fixes: #5059 (https://trac.ffmpeg.org/ticket/5059) Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
* | ffserver: Clear avio context after closing it in rtp_new_av_stream()Michael Niedermayer2015-11-301-0/+1
| | | | | | | | | | Suggested-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Clear avio context after closing itMichael Niedermayer2015-11-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: ==13287== Invalid read of size 4 ==13287== at 0x45161A: flush_buffer (aviobuf.c:143) ==13287== by 0x451971: avio_flush (aviobuf.c:200) ==13287== by 0x512CCF: av_write_trailer (mux.c:1016) ==13287== by 0x41A5E0: close_connection (ffserver.c:853) ==13287== by 0x421EDC: rtsp_cmd_interrupt (ffserver.c:3245) ==13287== by 0x420B9C: rtsp_parse_request (ffserver.c:2854) ==13287== by 0x41A9C2: handle_connection (ffserver.c:930) ==13287== by 0x41A04B: http_server (ffserver.c:700) ==13287== by 0x423A60: main (ffserver.c:3897) ==13287== Address 0xb6cd258 is 88 bytes inside a block of size 192 free'd ==13287== at 0x4C2B5D9: free (vg_replace_malloc.c:446) ==13287== by 0x1004DAC: av_free (mem.c:239) ==13287== by 0x454835: avio_close_dyn_buf (aviobuf.c:1170) ==13287== by 0x41F385: http_prepare_data (ffserver.c:2368) ==13287== by 0x41F59B: http_send_data (ffserver.c:2416) ==13287== by 0x41ABE2: handle_connection (ffserver.c:986) ==13287== by 0x41A04B: http_server (ffserver.c:700) ==13287== by 0x423A60: main (ffserver.c:3897) Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: add NULL context to ff_rtsp_parse_line().Nicolas George2015-11-291-1/+1
| | | | | | | | Needed after f62fe53/2c17fb6.
* | ffserver: Use AVOption API to access ffm demuxer instead of direct access ↵Michael Niedermayer2015-11-201-3/+3
| | | | | | | | | | | | | | | | | | depending on ABI server_attached is newly added so the demuxer knows if there is an attached server that can update the write index. This is needed to fix a infinite loop Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Replace one malloc(AVStream) by avformat_new_stream()Michael Niedermayer2015-11-111-6/+7
| | | | | | | | | | | | | | This fixes a null pointer dereference from the recently introduced AVStream->internal Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxerMichael Niedermayer2015-11-111-3/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>