Commit Graph

40783 Commits

Author SHA1 Message Date
Tomas Härdin 11467ecf51 mxfdec: reduce loop bound in mxf_read_pixel_layout()
Makes coverity less confused and code more readable.

Bug-Id: CID 732262
2014-10-27 19:08:02 +00:00
Vittorio Giovara e6c66f1e4e bethsoftvid: check return value and clean memory
CC: libav-stable@libav.org
Bug-Id: CID 733777
2014-10-27 18:21:40 +00:00
Vittorio Giovara b46b233baf filmstripdec: avoid integer overflow
CC: libav-stable@libav.org
Bug-Id: CID 732246
2014-10-27 18:21:40 +00:00
Vittorio Giovara 090c67d586 matroskaenc: write correct Display{Width, Height} in stereo encoding
should be the raw amount of pixels (for example 3840x1080 for full HD side by
side) and the DisplayWidth/Height in pixels should be the amount of pixels for
one plane (1920x1080 for that full HD stream)."

So, move the aspect ratio check in the mkv_write_stereo_mode() function
and always write the embl when stereo format and/or aspect ration is set.
Also add a few comments to that function.

CC: libav-stable@libav.org
Found-by: Asan Usipov <asan.usipov@gmail.com>
2014-10-27 18:21:35 +00:00
Luca Barbato a6674d2e77 xcbgrab: XCB-based screen capture
Matches the x11grab screen capture by features.
2014-10-26 08:47:41 +01:00
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ö 6b9b42cc55 drawtext: Remove the ifdef for localtime_r
If it isn't available in the system, we've got a fallback to
the normal localtime function, so normal code can assume it is
available as long as time_internal.h is included.

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ö 3f8f1c6ff2 lavu: Provide fallbacks for gmtime_r and localtime_r
This allows writing most code as if they always are is available.

These are ok to use from other libraries even though it's not a
public header, since they only provide an inline declaration, and
doesn't add an actual dependency on lavu internals. (This can be
considered more a build system compatibility fallback than a
libavutil feature.)

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
Vittorio Giovara ac84c1ce24 avfilter: check filter link validity
Remove now redundant check.

CC: libav-stable@libav.org
Bug-Id: CID 700371
2014-10-24 23:42:19 +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 88b32673db avconv: copy stream-level side data when streamcopying 2014-10-24 09:03:16 +02:00
Anton Khirnov c63418e0a3 doc: reword the mp3 muxer documentation
Make it more structured.
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
Martin Storsjö d0c0930219 avconv: Use av_gettime_relative
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:45 +03:00
Martin Storsjö 248d8fb60c avplay: Use av_gettime_relative
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:44 +03:00
Olivier Langlois e205429fcf tools: Use av_gettime_relative
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:43 +03:00
Olivier Langlois 6fdf35fe35 lavc: Use av_gettime_relative
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:42 +03:00
Martin Storsjö 1bd0bdcdc2 lavu: Add av_gettime_relative
Since av_gettime() is used in a number of places where actual
real time clock is required, the monotonic clock introduced in
ebef9f5a5 would have consequences that are hard to handle. Instead
split it into a separate function that can be used in the cases
where only relative time is desired.

On platform where no monotonic clock is available, the difference
between the two av_gettime functions is not clear, and one could
mistakenly use the relative clock where an absolute one is
required. Therefore add an offset, to make it evident that the
time returned from av_gettime_relative never is actual current
real time, even though it is based on av_gettime.

Based on a patch by Olivier Langlois.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:41 +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
Janne Grunau 04d8af5f17 fate-mpeg4: use TARGET_SAMPLES for resize tests 2014-10-21 09:57:10 +02: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 d1afd3e1d6 vf_format: check input validity
CC: libav-stable@libav.org
2014-10-20 10:38:38 +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