Commit Graph

10102 Commits

Author SHA1 Message Date
Martin Storsjö
ed6dad3737 lavf: Implement ff_brktimegm using gmtime_r
While a standalone implementation is nice, we already depend on
gmtime and gmtime_r in a number of places.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Martin Storsjö
82ee7d0dda Use gmtime_r instead of gmtime and localtime_r instead of localtime
gmtime isn't thread safe in general. In msvcrt (which lacks gmtime_r),
the buffer used by gmtime is thread specific though.

One call to localtime is left in avconv_opt.c, where thread safety
shouldn't matter (instead of making avconv depend on the libavutil
internal header).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Martin Storsjö
9dcf239721 lavf: Check the return value of strftime
If the buffer provided to strftime is too small, the buffer contents
are indeterminate - it does not guarantee actually null terminating
the buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Martin Storsjö
851ace79a3 wtv: Avoid needlessly calling gmtime twice with the same argument
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Vittorio Giovara
50dbe6b354 mov: fix assigment check
CC: libav-stable@libav.org
Bug-Id: CID 1197050
2014-10-24 23:48:57 +01:00
Tomas Härdin
7df3b426bb mxfenc: Fix possible integer overflows
None of these are likely unless the user is writing a file with two billion
streams or a duration of around two months.

CC: libav-stable@libav.org
Bug-Id: CID 700568 / CID 700569 / CID 700570 /
        CID 700571 / CID 700572 / CID 700573
2014-10-24 23:48:57 +01:00
Vittorio Giovara
ad6b00d85f mxfdec: add missing break
CC: libav-stable@libav.org
Bug-Id: CID 732232
2014-10-24 23:48:57 +01:00
Vittorio Giovara
28c020d4df matroskaenc: check avio_open_dyn_buf return value
CC: libav-stable@libav.org
Bug-Id: CID 703629
2014-10-24 23:48:57 +01:00
Vittorio Giovara
e0caa1eb4e matroskadec: check return values
CC: libav-stable@libav.org
Bug-Id: CID 733712
2014-10-24 23:48:51 +01:00
Vittorio Giovara
3c1199c3c4 matroskadec: fix leak on error
CC: libav-stable@libav.org
Bug-Id: CID 1026767
2014-10-24 23:43:25 +01:00
Luca Barbato
7785ce1c76 lavf: replace rename() with ff_rename()
The new function wraps errno so that its value is correctly reported
when other functions overwrite it (eg. in case of logging).

CC: libav-stable@libav.org
Bug-Id: CID 1135748
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-10-24 23:42:53 +01:00
Vittorio Giovara
0b66fb4505 flac_picture: prevent a possible out of bound write
At "mimetype[len] = 0;" mimetype is a 64 element array and len might be
equal to or greater than that.

CC: libav-stable@libav.org
Bug-Id: CID 1061055
2014-10-24 23:42:53 +01:00
Vittorio Giovara
f1ed83e23a img2dec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 1087077
2014-10-24 23:42:53 +01:00
Vittorio Giovara
1967cd4e4c audiointerleave: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 1087078
2014-10-24 23:42:53 +01:00
Anton Khirnov
ef363ebd59 mp3enc: write full LAME frame
Most importantly, it contains the encoder delay and replaygain info.
2014-10-24 09:03:16 +02:00
Anton Khirnov
99143140de mp3dec: fix reading the Xing tag
The quality scale field is only supposed to be present if the fourth bit
is set. In practice, lame always sets it, but other tools might not.

CC:libav-stable@libav.org
2014-10-24 09:03:16 +02:00
Martin Storsjö
6df9d9b55d lavf: Use av_gettime_relative
The ones left using av_gettime are NTP timestamps (for RTCP,
which is specified to send the actual current realtime clock
in RTCP SR packets), and the NUT muxer timestamper, which is
documented as using wallclock time.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:45 +03:00
Vittorio Giovara
af7ca6ea12 nutdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733713
2014-10-21 14:37:48 +01:00
Vittorio Giovara
b69183f65d nutenc: check for negative index rather than assert
CC: libav-stable@libav.org
Bug-Id: CID 703721
2014-10-21 14:37:48 +01:00
Vittorio Giovara
be42c0b8d5 rmdec: stricter error check to avoid theoretical unitialized use
CC: libav-stable@libav.org
Bug-Id: CID 90558
2014-10-21 14:37:48 +01:00
Vittorio Giovara
7207dd8f82 rmdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733714
2014-10-21 14:37:48 +01:00
Vittorio Giovara
629b2ed0ac flvdec: make sure to check create_stream and report the same error
CC: libav-stable@libav.org
Bug-Id: CID 732242
2014-10-21 14:37:48 +01:00
Vittorio Giovara
f22aa6b841 flvdec: avoid unitialized use of a struct member
CC: libav-stable@libav.org
Bug-Id: CID 718141
2014-10-21 14:37:48 +01:00
Vittorio Giovara
e73d26bbd6 smoothstreamingenc: explict cast to avoid overflow
CC: libav-stable@libav.org
Bug-Id: CID 732248
2014-10-21 14:37:48 +01:00
Luca Barbato
d2771a1dc0 rtpproto: Free the addrinfo pointer on failure
CC: libav-stable@libav.org
Bug-Id: CID 1238797
2014-10-20 10:47:29 +01:00
Luca Barbato
96bfb67747 nutdec: Prevent a memory corruption
Chapters do not have an event_flags field.

Bug-Id: CID 1231990
2014-10-20 10:47:03 +01:00
Vittorio Giovara
350ed18292 rtpdec_hevc: drop unnecessary check
len is always >=1 in that case.

Bug-Id: CID 1238784
2014-10-20 10:44:42 +01:00
Vittorio Giovara
322b571d55 rtmpproto: remove dead code
Expression already evaluated before, redundant since
0533868642.

Bug-Id: CID 732199
2014-10-20 10:44:22 +01:00
Vittorio Giovara
7b48bf9524 wtv: clean memory on error
CC: libav-stable@libav.org
Bug-Id: CID 718002
2014-10-20 10:38:38 +01:00
Vittorio Giovara
9fbc613f0d wtv: check seek_by_sector return value
CC: libav-stable@libav.org
Bug-Id: CID 1198258
2014-10-20 10:38:38 +01:00
Vittorio Giovara
d7f530b0d6 aviobuf: check context before using it
Avoid a possible null pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1135769
2014-10-20 10:38:38 +01:00
Michael Niedermayer
02484d1a93 avio: fix sizeof argument
CC: libav-stable@libav.org
Bug-Id: CID 732284
2014-10-20 10:38:38 +01:00
Vittorio Giovara
8ab3b71e4b idcin: fix return check
CC: libav-stable@libav.org
Bug-Id: CID 732198
2014-10-20 10:38:37 +01:00
Alexander Drozdov
0034314a69 rtmp: Always call rtmp_close() on rtmp_open() failure
Prevent possible memory leaks.

Connect to nginx and request a non-existent resource to
trigger the issue.

CC: libav-stable@libav.org

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Uwe L. Korn <uwelk@xhochy.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-10-18 17:37:11 +02:00
Anton Khirnov
fb238f8230 urlprotocol: remove unused url_interrupt_cb declaration
It is a remnant of the old interrupt callback API.
2014-10-18 05:01:20 +02:00
Uwe L. Korn
9bec3ca2b8 rtmpproto: Add pause support
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 23:13:51 +03:00
Uwe L. Korn
f4cd8b80b9 rtmpproto: Track last received timestamp
Some RTMP commands need the most recent timestamp as their parameter, so
keep track of it. This must be the most recent one and not e.g. the max
received timestamp as it can decrease again through seeking.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 23:13:37 +03:00
Uwe L. Korn
e65c776d18 rtmpproto: Add getStreamLength call to query duration
In (non-live) streams with no metadata, the duration of a stream can
be retrieved by calling the RTMP function getStreamLength with the
playpath. The server will return a positive duration upon the request if
the duration is known, otherwise either no response or a duration of 0
will be returned.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 12:07:19 +03:00
Uwe L. Korn
324b23dde1 rtmpproto: Add function to read a number response
Packets that contain a number as a result to a rtmp function call are
structured the same way (String, Number, Null, Number). This new method
also includes more bounds checks to better handle packets that are not
structured as expected.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 12:07:19 +03:00
Luca Barbato
0db6bbb24c avformat: Make avformat_free_context handle NULL
Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
2014-10-17 09:55:46 +01:00
Michael Lynch
460b509a34 rtsp: Check a memory allocation
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-16 09:19:03 +03:00
Martin Storsjö
79dd756e14 rtmpproto: Fix a typo
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 21:00:39 +03:00
Martin Storsjö
ced7238cd0 rtpdec_hevc: Use av_realloc instead of av_malloc+memcpy
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 20:54:32 +03:00
Martin Storsjö
752e71e74f rtpdec_hevc: Rename a variable for clarity
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 20:54:30 +03:00
Vittorio Giovara
74b0237798 mov: Correctly check the color transfer characteristics range
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:48:40 +01:00
Martin Storsjö
e5cfc8fdad sdp: Provide out of bound parameter sets for HEVC if extradata is set
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 12:12:54 +03:00
Martin Storsjö
9b7f932ee5 rtpdec_hevc: Parse out of band vps/sps/pps/sei from fmtp lines
These are assembled into extradata in the order vps/sps/pps/sei.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 12:12:02 +03:00
Anton Khirnov
2d6e58497e lavf: switch to AVCodecContext.framerate for demuxing 2014-10-15 06:37:55 +00:00
Martin Storsjö
a74f8121d8 mov: Handle tfdt atoms
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-14 13:52:32 +03:00
Martin Storsjö
c2c22c75cf movenc: Write tfdt atoms
These allow getting the absolute start timestamp of a fragment
without reading preceding timestamps. This fixes sync between
tracks if starting from fragments in different streams that don't
align exactly.

This also is a prerequisite for producing DASH content.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-14 13:52:32 +03:00