Compare commits
192 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b408dba231 | |||
| c1435f9dfb | |||
| 726faff0aa | |||
| 2e3f0a1c6f | |||
| 1768e02a04 | |||
| e0d1db72da | |||
| a5513ae7bc | |||
| 9c0b2b9d5b | |||
| d111c9ce13 | |||
| 6e1bc747df | |||
| 2c6792b0c6 | |||
| 66bf84e2c4 | |||
| 9f7eb718e9 | |||
| 2d66fbc853 | |||
| 2f26f3de78 | |||
| e9003828dd | |||
| 66e8f87ebc | |||
| 6bee6ef0c2 | |||
| ff01dbb6ec | |||
| 2caee48576 | |||
| 63caf18787 | |||
| 8ad4e1c1cb | |||
| 27fbf8f110 | |||
| 3f9a24f06d | |||
| 083919e9c4 | |||
| bc63205ae2 | |||
| 4251dc6d7e | |||
| 8fd3293fa1 | |||
| 7affe32738 | |||
| 1bc7215e8a | |||
| 51aa6d0987 | |||
| 136fc7084e | |||
| adc86ad32f | |||
| e0dd617ed7 | |||
| 9cab9b878f | |||
| 3549871847 | |||
| 9ec40eacb1 | |||
| 8cca6b06ec | |||
| 642cd5de4d | |||
| d54aa2de17 | |||
| bab7d72d46 | |||
| 9128ef0302 | |||
| 86f5b73429 | |||
| 9375a7d85e | |||
| e8ab2bd2ac | |||
| 45b18fbb9a | |||
| 0496403c08 | |||
| 88bf1d2749 | |||
| dbad792487 | |||
| 5d2f1ffef1 | |||
| 80b85300ae | |||
| 48d24cca13 | |||
| 1c282152c1 | |||
| 4ffd5805af | |||
| 57665e04e2 | |||
| 48496e4d4f | |||
| e93934e100 | |||
| b32c9941a2 | |||
| 69673d0279 | |||
| 3047b0a4a3 | |||
| 27888d13b8 | |||
| 416a8a06b9 | |||
| e14cc2f197 | |||
| 05e6606ba9 | |||
| c3307f7e9e | |||
| 3d82cebdd2 | |||
| 5801482379 | |||
| e6197a6ce9 | |||
| e78d9f3f35 | |||
| ef2d91e9c3 | |||
| dcc8d2418a | |||
| 087b777415 | |||
| aca7f5f060 | |||
| aa32d41527 | |||
| a1e6daeb1e | |||
| 30d542d55d | |||
| 1d439041ec | |||
| 0009cf348a | |||
| 492bbe5890 | |||
| 5771a0c823 | |||
| f309b698e6 | |||
| 0887f1835d | |||
| de42af2bee | |||
| ada229e66f | |||
| 047e0049d1 | |||
| 88f52f2f8f | |||
| 8baf2d8fad | |||
| 17b8e7799f | |||
| 6457346e6a | |||
| 27f1fb1251 | |||
| c993a11e56 | |||
| ef5b120e2d | |||
| b9a1d389b2 | |||
| 8c43f32057 | |||
| 77d5a237ef | |||
| fb7617df4e | |||
| 82b58841c9 | |||
| e5bf7ab3e7 | |||
| 63f951601e | |||
| 7fefa4138d | |||
| a1f77124c8 | |||
| f2f7d49f41 | |||
| 9357aa6757 | |||
| 26a8fc1c00 | |||
| b7b3b0086d | |||
| d669b7f4f6 | |||
| 9259b7f38e | |||
| cb8a29f872 | |||
| 6744d3f6b9 | |||
| 73b644cdee | |||
| 3512ed3622 | |||
| 1d90326f95 | |||
| 1b47c278a6 | |||
| cd91aaa4cc | |||
| 2858f77fd4 | |||
| fe7366ee93 | |||
| 4ab41164d2 | |||
| d794d97d96 | |||
| 93534cd642 | |||
| ca92adafb0 | |||
| 815a4439c3 | |||
| 17035c8d2e | |||
| 426b959e37 | |||
| 61fcba7546 | |||
| 66bd740e0b | |||
| 534dc63089 | |||
| 09d1854063 | |||
| ab9616428a | |||
| e7c00a2814 | |||
| 2a8441e949 | |||
| 7876fd679d | |||
| 8b3d9c33d6 | |||
| c575726621 | |||
| 6e6609f5dd | |||
| 6e13acaadd | |||
| a5680d83af | |||
| 811d560378 | |||
| c34f0616d9 | |||
| 96ce6f64cc | |||
| 13b6852225 | |||
| d13ba39606 | |||
| 19b86db2b3 | |||
| 694d37eb52 | |||
| 4e5d1c45f1 | |||
| 2577cfd207 | |||
| 280587b4ab | |||
| 5bf11223dd | |||
| 679e869496 | |||
| 7216068e42 | |||
| e7a064efa6 | |||
| a004e2e4f1 | |||
| f50f7adf7a | |||
| 9cf85419a3 | |||
| b3fe93e73b | |||
| 603fd4f771 | |||
| 76a239768f | |||
| fca62cc6a7 | |||
| 9f1e8b4fb2 | |||
| b2a2b1a88b | |||
| f3c1a76ffd | |||
| b62191f9c1 | |||
| 21c36d83f8 | |||
| 4774eb8128 | |||
| 96f5019bde | |||
| bffe1c4222 | |||
| fbdf5ca763 | |||
| c6470d8193 | |||
| e5942c1436 | |||
| dab82a2a7c | |||
| 7f864badc0 | |||
| cc1e01d8b6 | |||
| 69c3dfdd54 | |||
| 241f1e603f | |||
| 4d9fdca053 | |||
| b11900251f | |||
| 145b18ce9a | |||
| e5d167149d | |||
| ed71759fd0 | |||
| d7ae13d479 | |||
| 1cd872a7d5 | |||
| f6586db165 | |||
| 7c43c48fda | |||
| 069eea16d9 | |||
| 79181b97d4 | |||
| 46360e36d9 | |||
| ef2b8416d9 | |||
| 9491f47035 | |||
| 2fc7e5c1b5 | |||
| 68dcb46205 | |||
| 8dce66d33d | |||
| 08c21bcb5d | |||
| e675926a4f |
@@ -1,6 +1,195 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 3.0.5:
|
||||
- configure: check for strtoull on msvc
|
||||
- http: move chunk handling from http_read_stream() to http_buf_read().
|
||||
- http: make length/offset-related variables unsigned.
|
||||
- ffserver: Check chunk size
|
||||
- Avoid using the term "file" and prefer "url" in some docs and comments
|
||||
- avformat/rtmppkt: Check for packet size mismatches
|
||||
- zmqsend: Initialize ret to 0
|
||||
- avcodec/rawdec: check for side data before checking its size
|
||||
- avcodec/flacdec: Fix undefined shift in decode_subframe()
|
||||
- avcodec/get_bits: Fix get_sbits_long(0)
|
||||
- avformat/ffmdec: Check media type for chunks
|
||||
- avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()
|
||||
- avcodec/flacdsp_template: Fix undefined shift in flac_decorrelate_indep_c
|
||||
- avformat/oggparsespeex: Check frames_per_packet and packet_size
|
||||
- avformat/utils: Check start/end before computing duration in update_stream_timings()
|
||||
- avcodec/flac_parser: Update nb_headers_buffered
|
||||
- avformat/idroqdec: Check chunk_size for being too large
|
||||
- avformat/mpeg: Adjust vid probe threshold to correct mis-detection
|
||||
- avcodec/rv40: Test remaining space in loop of get_dimension()
|
||||
- avcodec/ituh263dec: Avoid spending a long time in slice sync
|
||||
- avcodec/movtextdec: Add error message for tsmb_size check
|
||||
- avcodec/movtextdec: Fix tsmb_size check==0 check
|
||||
- avcodec/movtextdec: Fix potential integer overflow
|
||||
- avcodec/sunrast: Fix input buffer pointer check
|
||||
- avcodec/tscc: Check side data size before use
|
||||
- avcodec/rawdec: Check side data size before use
|
||||
- avcodec/msvideo1: Check side data size before use
|
||||
- avcodec/qpeg: Check side data size before use
|
||||
- avcodec/qtrle: Check side data size before use
|
||||
- avcodec/msrle: Check side data size before use
|
||||
- avcodec/kmvc: Check side data size before use
|
||||
- avcodec/idcinvideo: Check side data size before use
|
||||
- avcodec/cinepak: Check side data size before use
|
||||
- avcodec/8bps: Check side data size before use
|
||||
- avcodec/dvdsubdec: Fix off by 1 error
|
||||
- avcodec/dvdsubdec: Fix buf_size check
|
||||
- vp9: change order of operations in adapt_prob().
|
||||
- avcodec/interplayvideo: Check side data size before use
|
||||
- avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()
|
||||
- avcodec/mpegvideo_enc: Clear mmx state in ff_mpv_reallocate_putbitbuffer()
|
||||
- avcodec/utils: Clear MMX state before returning from avcodec_default_execute*()
|
||||
- avformat/icodec: Fix crash probing fuzzed file
|
||||
- dcstr: fix division by zero
|
||||
- rsd: limit number of channels
|
||||
- mss2: only use error correction for matching block counts
|
||||
- softfloat: decrease MIN_EXP to cover full float range
|
||||
- libopusdec: default to stereo for invalid number of channels
|
||||
- pgssubdec: only set w/h/linesize when allocating data
|
||||
- sbgdec: prevent NULL pointer access
|
||||
- smacker: limit recursion depth of smacker_decode_bigtree
|
||||
- mxfdec: fix NULL pointer dereference in mxf_read_packet_old
|
||||
- libschroedingerdec: fix leaking of framewithpts
|
||||
- libschroedingerdec: don't produce empty frames
|
||||
- softfloat: handle -INT_MAX correctly
|
||||
- filmstripdec: correctly check image dimensions
|
||||
- pnmdec: make sure v is capped by maxval
|
||||
- smvjpegdec: make sure cur_frame is not negative
|
||||
- icodec: correctly check avio_read return value
|
||||
- dvbsubdec: fix division by zero in compute_default_clut
|
||||
- proresdec_lgpl: explicitly check coff[3] against slice_data_size
|
||||
- escape124: reject codebook size 0
|
||||
- icodec: add ico_read_close to fix leaking ico->images
|
||||
- icodec: fix leaking pkt on error
|
||||
- mpegts: prevent division by zero
|
||||
- matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header
|
||||
- mpegaudio_parser: don't return AVERROR_PATCHWELCOME
|
||||
- mxfdec: fix NULL pointer dereference
|
||||
- lzf: update pointer p after realloc
|
||||
- diracdec: check return code of get_buffer_with_edge
|
||||
- ppc: pixblockdsp: do unaligned block accesses correctly again
|
||||
- interplayacm: increase bitstream buffer size by AV_INPUT_BUFFER_PADDING_SIZE
|
||||
- interplayacm: validate number of channels
|
||||
- interplayacm: check for too large b
|
||||
- mpeg12dec: unref discarded picture from extradata
|
||||
- cavsdec: unref frame before referencing again
|
||||
- avformat: prevent triggering request_probe assert in ff_read_packet
|
||||
- avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()
|
||||
|
||||
|
||||
version 3.0.4:
|
||||
- libopenjpegenc: fix out-of-bounds reads when filling the edges
|
||||
- libopenjpegenc: stop reusing image data buffer for openjpeg 2
|
||||
- configure: fix detection of libopenjpeg
|
||||
- cmdutils: fix typos
|
||||
- lavfi: fix typos
|
||||
- lavc: fix typos
|
||||
- tools: fix grammar error
|
||||
- ffmpeg: remove unused and errorneous AVFrame timestamp check
|
||||
- Support for MIPS cpu P6600
|
||||
- avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r
|
||||
- avformat/avidec: Check nb_streams in read_gab2_sub()
|
||||
- avformat/avidec: Remove ancient assert
|
||||
- avformat/avidec: Fix memleak with dv in avi
|
||||
- lavc/movtextdec.c: Avoid infinite loop on invalid data.
|
||||
- avcodec/ansi: Check dimensions
|
||||
- avcodec/cavsdsp: use av_clip_uint8() for idct
|
||||
- avformat/movenc: Check packet in mov_write_single_packet() too
|
||||
- avformat/movenc: Factor check_pkt() out
|
||||
- avformat/utils: fix timebase error in avformat_seek_file()
|
||||
- avcodec/g726: Add missing ADDB output mask
|
||||
- avcodec/avpacket: clear side_data_elems
|
||||
- avformat/movenc: Check first DTS similar to dts difference
|
||||
- avcodec/ccaption_dec: Use simple array instead of AVBuffer
|
||||
- avformat/mov: Fix potential integer overflow in mov_read_keys
|
||||
- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
|
||||
- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
|
||||
- lavf/utils: Avoid an overflow for huge negative durations.
|
||||
|
||||
version 3.0.3:
|
||||
- avformat/avidec: Fix infinite loop in avi_read_nikon()
|
||||
- avcodec/aacenc: Tighter input checks
|
||||
- avformat/wtvdec: Check pointer before use
|
||||
- libavcodec/wmalosslessdec: Check the remaining bits
|
||||
- avcodec/diracdec: Check numx/y
|
||||
- avcodec/cfhd: Increase minimum band dimension to 3
|
||||
- avcodec/indeo2: check ctab
|
||||
- avformat/swfdec: Fix inflate() error code check
|
||||
- avcodec/rawdec: Fix bits_per_coded_sample checks
|
||||
- lavc/mjpegdec: Do not skip reading quantization tables.
|
||||
- cmdutils: fix implicit declaration of SetDllDirectory function
|
||||
- cmdutils: check for SetDllDirectory() availability
|
||||
- avcodec/h264: Put context_count check back
|
||||
- cmdutils: remove the current working directory from the DLL search path on win32
|
||||
- avcodec/raw: Fix decoding of ilacetest.mov
|
||||
- avcodec/ffv1enc: Fix assertion failure with non zero bits per sample
|
||||
- avformat/oggdec: Fix integer overflow with invalid pts
|
||||
- ffplay: Fix invalid array index
|
||||
- avcodec/vp9_parser: Check the input frame sizes for being consistent
|
||||
- libavformat/rtpdec_asf: zero initialize the AVIOContext struct
|
||||
- libavutil/opt: Small bugfix in example.
|
||||
- libx264: Increase x264 opts character limit to 4096
|
||||
- avformat/mov: Check sample size
|
||||
- avformat/format: Fix registering a format more than once and related races
|
||||
- avformat/flacdec: Fix seeking close to EOF
|
||||
- avcodec/flac_parser: Raise threshold for detecting invalid data
|
||||
- avformat/flvdec: Accept last size if its off by 1
|
||||
- tests/api/api-codec-param-test: Do not directly access caps_internal
|
||||
- avcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()
|
||||
- avfilter/vf_telecine: Make frame writable before writing into it
|
||||
- avformat/mpegts: adjust probe score for low check_count
|
||||
- avcodec/mpc8: Correct end truncation
|
||||
- avformat/mp3dec: Increase probe score slightly when the whole data from begin to end is mp3
|
||||
- avcodec/cfhd: Set dimensions unconditionally
|
||||
- avcodec/mpegvideo: Do not clear the parse context during init
|
||||
- avcodec/h264: Fix off by 1 context count
|
||||
- avcodec/alsdec: Check r to prevent out of array read
|
||||
- avcodec/alsdec: fix max bits in ltp prefix code
|
||||
- avcodec/utils: check skip_samples signedness
|
||||
- avformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream
|
||||
- avcodec/bmp_parser: Check fsize
|
||||
- avcodec/bmp_parser: reset state
|
||||
- avcodec/bmp_parser: Fix remaining size
|
||||
- avcodec/bmp_parser: Fix frame_start_found in cross frame cases
|
||||
- avfilter/af_amix: do not fail if there are no samples in output_frame()
|
||||
- avformat/allformats: Making av_register_all() thread-safe.
|
||||
- librtmp: Avoid an infiniloop setting connection arguments
|
||||
- avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
|
||||
- Revert "configure: Enable GCC vectorization on ≥4.9 on x86"
|
||||
- avcodec/libopenjpegenc: Set numresolutions by default to a value that is not too large
|
||||
- ffplay: Fix usage of private lavfi API
|
||||
- tests/checkasm/checkasm: Disable checkasm_check_pixblockdsp for ppc64be
|
||||
- avcodec/mpegvideo: Deallocate last/next picture earlier
|
||||
- avcodec/bmp_parser: Fix state
|
||||
- avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
|
||||
- avformat/utils: avoid overflow in compute_chapters_end() with huge durations
|
||||
- avformat/utils: avoid overflow in update_stream_timings() with huge durations
|
||||
- doc/developer.texi: Add a code of conduct
|
||||
- ffserver: fixed deallocation bug in build_feed_streams
|
||||
- avcodec/diracdec: Fix potential integer overflow
|
||||
- avformat/avidec: Detect index with too short entries
|
||||
- avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
|
||||
- avformat/utils: Do not compute the bitrate from duration == 0
|
||||
- ffmpeg: Check that r_frame_rate is set before attempting to use it
|
||||
- swresample/resample: Fix division by 0 with tap_count=1
|
||||
- swresample/rematrix: Use clipping s16 rematrixing if overflows are possible
|
||||
- swresample/rematrix: Use error diffusion to avoid error in the DC component of the matrix
|
||||
- hevc: Fix memory leak related to a53_caption data
|
||||
- libavformat/oggdec: Free stream private when header parsing fails.
|
||||
- avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
|
||||
- avformat/oggparseopus: Check that granule pos is within the supported range
|
||||
- avcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for progressive jpeg
|
||||
- avformat/options_table: Add missing identifier for very strict compliance
|
||||
- avformat/ffmdec: Check pix_fmt
|
||||
- doc/general: update supported DCA extensions
|
||||
- avcodec/rscc: check input buffer size for deflate mode
|
||||
- avcodec/dca: fix sync word search error condition
|
||||
- lavf/mpegts: Return small probe score for very short transport streams.
|
||||
|
||||
|
||||
version 3.0.2:
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
|
||||
+4
-5
@@ -56,7 +56,7 @@ Communication
|
||||
website Deby Barbara Lepage
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
|
||||
mailing lists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
mailing lists Baptiste Coudurier, Lou Logan
|
||||
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
|
||||
Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
|
||||
Launchpad Timothy Gu
|
||||
@@ -168,7 +168,7 @@ Codecs:
|
||||
dirac* Rostislav Pehlivanov
|
||||
dnxhd* Baptiste Coudurier
|
||||
dpcm.c Mike Melanson
|
||||
dss_sp.c Oleksij Rempel, Michael Niedermayer
|
||||
dss_sp.c Oleksij Rempel
|
||||
dv.c Roman Shaposhnik
|
||||
dvbsubdec.c Anshul Maheshwari
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -422,7 +422,7 @@ Muxers/Demuxers:
|
||||
cdxl.c Paul B Mahol
|
||||
crc.c Michael Niedermayer
|
||||
daud.c Reimar Doeffinger
|
||||
dss.c Oleksij Rempel, Michael Niedermayer
|
||||
dss.c Oleksij Rempel
|
||||
dtshddec.c Paul B Mahol
|
||||
dv.c Roman Shaposhnik
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -458,7 +458,7 @@ Muxers/Demuxers:
|
||||
mgsts.c Paul B Mahol
|
||||
microdvd* Aurelien Jacobs
|
||||
mm.c Peter Ross
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
mov.c Baptiste Coudurier
|
||||
movenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
movenccenc.c Eran Kornblau
|
||||
mpc.c Kostya Shishkov
|
||||
@@ -563,7 +563,6 @@ Windows MSVC Matthew Oliver, Hendrik Leppkes
|
||||
Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
x86 Michael Niedermayer
|
||||
OS/2 KO Myung-Hun
|
||||
|
||||
|
||||
|
||||
+14
-2
@@ -61,6 +61,9 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
@@ -107,6 +110,15 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
|
||||
}
|
||||
}
|
||||
|
||||
void init_dynload(void)
|
||||
{
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
/* Calling SetDllDirectory with the empty string (but not NULL) removes the
|
||||
* current working directory from the DLL search path as a security pre-caution. */
|
||||
SetDllDirectory("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void (*program_exit)(int ret);
|
||||
|
||||
void register_exit(void (*cb)(int ret))
|
||||
@@ -2099,7 +2111,7 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sources for %s:\n", fmt->name);
|
||||
printf("Auto-detected sources for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sources. Not implemented.\n");
|
||||
@@ -2129,7 +2141,7 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sinks for %s:\n", fmt->name);
|
||||
printf("Auto-detected sinks for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sinks. Not implemented.\n");
|
||||
|
||||
+7
-2
@@ -61,6 +61,11 @@ void register_exit(void (*cb)(int ret));
|
||||
*/
|
||||
void exit_program(int ret) av_noreturn;
|
||||
|
||||
/**
|
||||
* Initialize dynamic library loading
|
||||
*/
|
||||
void init_dynload(void);
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
* allocate the *_opts contexts.
|
||||
@@ -445,13 +450,13 @@ int show_devices(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
/**
|
||||
* Print a listing containing audodetected sinks of the output device.
|
||||
* Print a listing containing autodetected sinks of the output device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sinks(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing audodetected sources of the input device.
|
||||
* Print a listing containing autodetected sources of the input device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sources(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
@@ -1900,6 +1900,7 @@ SYSTEM_FUNCS="
|
||||
sched_getaffinity
|
||||
SetConsoleTextAttribute
|
||||
SetConsoleCtrlHandler
|
||||
SetDllDirectory
|
||||
setmode
|
||||
setrlimit
|
||||
Sleep
|
||||
@@ -4188,7 +4189,7 @@ elif enabled mips; then
|
||||
enable mips32r2
|
||||
disable msa
|
||||
;;
|
||||
p5600|i6400)
|
||||
p5600|i6400|p6600)
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
@@ -4253,6 +4254,10 @@ elif enabled mips; then
|
||||
enable mips64r6
|
||||
check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
|
||||
;;
|
||||
p6600)
|
||||
enable mips64r6
|
||||
check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# We do not disable anything. Is up to the user to disable the unwanted features.
|
||||
@@ -5317,6 +5322,7 @@ check_func_headers windows.h MapViewOfFile
|
||||
check_func_headers windows.h PeekNamedPipe
|
||||
check_func_headers windows.h SetConsoleTextAttribute
|
||||
check_func_headers windows.h SetConsoleCtrlHandler
|
||||
check_func_headers windows.h SetDllDirectory
|
||||
check_func_headers windows.h Sleep
|
||||
check_func_headers windows.h VirtualAlloc
|
||||
check_struct windows.h "CONDITION_VARIABLE" Ptr
|
||||
@@ -5479,10 +5485,11 @@ enabled libopencv && { check_header opencv2/core/core_c.h &&
|
||||
require_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
|
||||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
|
||||
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
|
||||
enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
|
||||
check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
|
||||
check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
|
||||
{ check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
{ check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
{ check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
|
||||
die "ERROR: libopenjpeg not found"; }
|
||||
enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
|
||||
enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
|
||||
@@ -5923,11 +5930,7 @@ elif enabled ccc; then
|
||||
add_cflags -msg_disable nonstandcast
|
||||
add_cflags -msg_disable unsupieee
|
||||
elif enabled gcc; then
|
||||
case $gcc_basever in
|
||||
4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
4.*) check_optflags -fno-tree-vectorize ;;
|
||||
*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
esac
|
||||
check_optflags -fno-tree-vectorize
|
||||
check_cflags -Werror=format-security
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
@@ -5992,6 +5995,7 @@ __declspec($_restrict) void* foo(int);
|
||||
EOF
|
||||
fi
|
||||
check_func strtoll || add_cflags -Dstrtoll=_strtoi64
|
||||
check_func strtoull || add_cflags -Dstrtoull=_strtoui64
|
||||
fi
|
||||
|
||||
for pfx in "" host_; do
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.0.2
|
||||
PROJECT_NUMBER = 3.0.5
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
||||
@@ -403,6 +403,35 @@ finding a new maintainer and also don't forget to update the @file{MAINTAINERS}
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
@section Code of conduct
|
||||
|
||||
Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
|
||||
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
|
||||
Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it's rarely good to start with that as initial assumption.
|
||||
|
||||
Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
|
||||
Try to help other team members and cooperate if you can.
|
||||
|
||||
The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
|
||||
If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
|
||||
Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
|
||||
@@ -93,10 +93,9 @@ static int decode_packet(int *got_frame, int cached)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("video_frame%s n:%d coded_n:%d pts:%s\n",
|
||||
printf("video_frame%s n:%d coded_n:%d\n",
|
||||
cached ? "(cached)" : "",
|
||||
video_frame_count++, frame->coded_picture_number,
|
||||
av_ts2timestr(frame->pts, &video_dec_ctx->time_base));
|
||||
video_frame_count++, frame->coded_picture_number);
|
||||
|
||||
/* copy decoded frame to destination buffer:
|
||||
* this is required since rawvideo expects non aligned data */
|
||||
|
||||
+9
-9
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_file}@} ... @{[@var{output_file_options}] @file{output_file}@} ...
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@} ... @{[@var{output_file_options}] @file{output_url}@} ...
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,10 +24,10 @@ rates and resize video on the fly with a high quality polyphase filter.
|
||||
@command{ffmpeg} reads from an arbitrary number of input "files" (which can be regular
|
||||
files, pipes, network streams, grabbing devices, etc.), specified by the
|
||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
||||
specified by a plain output filename. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output filename.
|
||||
specified by a plain output url. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output url.
|
||||
|
||||
Each input or output file can, in principle, contain any number of streams of
|
||||
Each input or output url can, in principle, contain any number of streams of
|
||||
different types (video/audio/subtitle/attachment/data). The allowed number and/or
|
||||
types of streams may be limited by the container format. Selecting which
|
||||
streams from which inputs will go into which output is either done automatically
|
||||
@@ -243,8 +243,8 @@ Force input or output file format. The format is normally auto detected for inpu
|
||||
files and guessed from the file extension for output files, so this option is not
|
||||
needed in most cases.
|
||||
|
||||
@item -i @var{filename} (@emph{input})
|
||||
input file name
|
||||
@item -i @var{url} (@emph{input})
|
||||
input file url
|
||||
|
||||
@item -y (@emph{global})
|
||||
Overwrite output files without asking.
|
||||
@@ -281,7 +281,7 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
|
||||
When used as an input option (before @code{-i}), limit the @var{duration} of
|
||||
data read from the input file.
|
||||
|
||||
When used as an output option (before an output filename), stop writing the
|
||||
When used as an output option (before an output url), stop writing the
|
||||
output after its duration reaches @var{duration}.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
@@ -310,7 +310,7 @@ extra segment between the seek point and @var{position} will be decoded and
|
||||
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
|
||||
will be preserved.
|
||||
|
||||
When used as an output option (before an output filename), decodes but discards
|
||||
When used as an output option (before an output url), decodes but discards
|
||||
input until the timestamps reach @var{position}.
|
||||
|
||||
@var{position} must be a time duration specification,
|
||||
@@ -1129,7 +1129,7 @@ may be reassigned to a different value.
|
||||
For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
|
||||
an output mpegts file:
|
||||
@example
|
||||
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
|
||||
ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
|
||||
@end example
|
||||
|
||||
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffplay [@var{options}] [@file{input_file}]
|
||||
ffplay [@var{options}] [@file{input_url}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -106,8 +106,8 @@ the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
sources and sinks).
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
@end table
|
||||
|
||||
@section Advanced options
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffprobe [@var{options}] [@file{input_file}]
|
||||
ffprobe [@var{options}] [@file{input_url}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,8 +24,8 @@ For example it can be used to check the format of the container used
|
||||
by a multimedia stream and the format and type of each media stream
|
||||
contained in it.
|
||||
|
||||
If a filename is specified in input, ffprobe will try to open and
|
||||
probe the file content. If the file cannot be opened or recognized as
|
||||
If a url is specified in input, ffprobe will try to open and
|
||||
probe the url content. If the url cannot be opened or recognized as
|
||||
a multimedia file, a positive exit code is returned.
|
||||
|
||||
ffprobe may be employed both as a standalone application or in
|
||||
@@ -332,8 +332,8 @@ with name "PIXEL_FORMAT".
|
||||
Force bitexact output, useful to produce output which is not dependent
|
||||
on the specific build.
|
||||
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
+1
-1
@@ -950,7 +950,7 @@ following image formats are supported:
|
||||
@item COOK @tab @tab X
|
||||
@tab All versions except 5.1 are supported.
|
||||
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
||||
@tab supported extensions: XCh, XLL (partially)
|
||||
@tab supported extensions: XCh, XXCH, X96, XBR, XLL
|
||||
@item DPCM id RoQ @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
||||
@item DPCM Interplay @tab @tab X
|
||||
|
||||
@@ -2014,12 +2014,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
}
|
||||
}
|
||||
|
||||
/* if the decoder provides a pts, use it instead of the last packet pts.
|
||||
the decoder could be delaying output by a packet or more. */
|
||||
if (decoded_frame->pts != AV_NOPTS_VALUE) {
|
||||
ist->dts = ist->next_dts = ist->pts = ist->next_pts = av_rescale_q(decoded_frame->pts, avctx->time_base, AV_TIME_BASE_Q);
|
||||
decoded_frame_tb = avctx->time_base;
|
||||
} else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
|
||||
if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
|
||||
decoded_frame->pts = decoded_frame->pkt_pts;
|
||||
decoded_frame_tb = ist->st->time_base;
|
||||
} else if (pkt->pts != AV_NOPTS_VALUE) {
|
||||
@@ -2893,7 +2888,8 @@ static int transcode_init(void)
|
||||
* overhead
|
||||
*/
|
||||
if(!strcmp(oc->oformat->name, "avi")) {
|
||||
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
if ( copy_tb<0 && ist->st->r_frame_rate.num
|
||||
&& av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
|
||||
&& av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|
||||
@@ -4267,6 +4263,8 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
int64_t ti;
|
||||
|
||||
init_dynload();
|
||||
|
||||
register_exit(ffmpeg_cleanup);
|
||||
|
||||
setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
|
||||
|
||||
+2
-2
@@ -2989,8 +2989,8 @@ enum OptGroup {
|
||||
};
|
||||
|
||||
static const OptionGroupDef groups[] = {
|
||||
[GROUP_OUTFILE] = { "output file", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input file", "i", OPT_INPUT },
|
||||
[GROUP_OUTFILE] = { "output url", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input url", "i", OPT_INPUT },
|
||||
};
|
||||
|
||||
static int open_files(OptionGroupList *l, const char *inout,
|
||||
|
||||
@@ -2730,7 +2730,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
goto fail;
|
||||
link = is->out_audio_filter->inputs[0];
|
||||
sample_rate = link->sample_rate;
|
||||
nb_channels = link->channels;
|
||||
nb_channels = avfilter_link_get_channels(link);
|
||||
channel_layout = link->channel_layout;
|
||||
}
|
||||
#else
|
||||
@@ -2931,7 +2931,7 @@ static int read_thread(void *arg)
|
||||
AVStream *st = ic->streams[i];
|
||||
enum AVMediaType type = st->codec->codec_type;
|
||||
st->discard = AVDISCARD_ALL;
|
||||
if (wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0)
|
||||
st_index[type] = i;
|
||||
}
|
||||
@@ -3771,6 +3771,8 @@ int main(int argc, char **argv)
|
||||
VideoState *is;
|
||||
char dummy_videodriver[] = "SDL_VIDEODRIVER=dummy";
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
parse_loglevel(argc, argv, options);
|
||||
|
||||
|
||||
@@ -3178,6 +3178,8 @@ int main(int argc, char **argv)
|
||||
char *w_name = NULL, *w_args = NULL;
|
||||
int ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
register_exit(ffprobe_cleanup);
|
||||
|
||||
|
||||
+7
-1
@@ -2701,8 +2701,10 @@ static int http_receive_data(HTTPContext *c)
|
||||
} else if (c->buffer_ptr - c->buffer >= 2 &&
|
||||
!memcmp(c->buffer_ptr - 1, "\r\n", 2)) {
|
||||
c->chunk_size = strtol(c->buffer, 0, 16);
|
||||
if (c->chunk_size == 0) // end of stream
|
||||
if (c->chunk_size <= 0) { // end of stream or invalid chunk size
|
||||
c->chunk_size = 0;
|
||||
goto fail;
|
||||
}
|
||||
c->buffer_ptr = c->buffer;
|
||||
break;
|
||||
} else if (++loop_run > 10)
|
||||
@@ -2724,6 +2726,7 @@ static int http_receive_data(HTTPContext *c)
|
||||
/* end of connection : close it */
|
||||
goto fail;
|
||||
else {
|
||||
av_assert0(len <= c->chunk_size);
|
||||
c->chunk_size -= len;
|
||||
c->buffer_ptr += len;
|
||||
c->data_count += len;
|
||||
@@ -3858,6 +3861,8 @@ drop:
|
||||
if (avformat_write_header(s, NULL) < 0) {
|
||||
http_log("Container doesn't support the required parameters\n");
|
||||
avio_closep(&s->pb);
|
||||
s->streams = NULL;
|
||||
s->nb_streams = 0;
|
||||
avformat_free_context(s);
|
||||
goto bail;
|
||||
}
|
||||
@@ -3973,6 +3978,7 @@ int main(int argc, char **argv)
|
||||
int cfg_parsed;
|
||||
int ret = EXIT_FAILURE;
|
||||
|
||||
init_dynload();
|
||||
|
||||
config.filename = av_strdup("/etc/ffserver.conf");
|
||||
|
||||
|
||||
+5
-2
@@ -120,12 +120,15 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample <= 8) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
if (pal) {
|
||||
&size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
|
||||
memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
|
||||
+2
-2
@@ -609,8 +609,8 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
|
||||
for (k = 0; k < 1024; k++) {
|
||||
if (!isfinite(cpe->ch[ch].coeffs[k])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
|
||||
if (!(fabs(cpe->ch[ch].coeffs[k]) < 1E16)) { // Ensure headroom for energy calculation
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains (near) NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -765,8 +765,13 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
|
||||
bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
|
||||
|
||||
r = get_unary(gb, 0, 3);
|
||||
r = get_unary(gb, 0, 4);
|
||||
c = get_bits(gb, 2);
|
||||
if (r >= 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "r overflow\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bd->ltp_gain[2] = ltp_gain_values[r][c];
|
||||
|
||||
bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
|
||||
|
||||
@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", avctx->width, avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ static inline void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
|
||||
} else {
|
||||
put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);
|
||||
if (level < -128 || level > 127) {
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Cliping level %d, increase qscale\n", level);
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level);
|
||||
level = av_clip_int8(level);
|
||||
}
|
||||
asv2_put_bits(pb, 8, level & 0xFF);
|
||||
|
||||
@@ -184,6 +184,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
|
||||
{
|
||||
pkt->data = NULL;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
if (pkt->buf) {
|
||||
AVBufferRef *ref = av_buffer_ref(src->buf);
|
||||
if (!ref)
|
||||
@@ -193,9 +194,11 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
|
||||
} else {
|
||||
DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
|
||||
}
|
||||
if (pkt->side_data_elems && dup)
|
||||
if (src->side_data_elems && dup) {
|
||||
pkt->side_data = src->side_data;
|
||||
if (pkt->side_data_elems && !dup) {
|
||||
pkt->side_data_elems = src->side_data_elems;
|
||||
}
|
||||
if (src->side_data_elems && !dup) {
|
||||
return av_copy_packet_side_data(pkt, src);
|
||||
}
|
||||
return 0;
|
||||
@@ -277,16 +280,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
uint8_t *data, size_t size)
|
||||
{
|
||||
AVPacketSideData *tmp;
|
||||
int elems = pkt->side_data_elems;
|
||||
|
||||
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
|
||||
return AVERROR(ERANGE);
|
||||
|
||||
pkt->side_data = av_realloc(pkt->side_data,
|
||||
(elems + 1) * sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
tmp = av_realloc(pkt->side_data, (elems + 1) * sizeof(*tmp));
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
pkt->side_data = tmp;
|
||||
pkt->side_data[elems].data = data;
|
||||
pkt->side_data[elems].size = size;
|
||||
pkt->side_data[elems].type = type;
|
||||
|
||||
+12
-4
@@ -53,7 +53,8 @@ restart:
|
||||
if (bpc->pc.frame_start_found == 0) {
|
||||
if ((state >> 48) == (('B' << 8) | 'M')) {
|
||||
bpc->fsize = av_bswap32(state >> 16);
|
||||
bpc->pc.frame_start_found = 1;
|
||||
if (bpc->fsize > 17)
|
||||
bpc->pc.frame_start_found = 1;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found == 2+4+4) {
|
||||
// unsigned hsize = av_bswap32(state>>32);
|
||||
@@ -63,12 +64,16 @@ restart:
|
||||
continue;
|
||||
}
|
||||
bpc->pc.frame_start_found++;
|
||||
bpc->remaining_size = bpc->fsize + FFMAX(i - 17, 0);
|
||||
bpc->remaining_size = bpc->fsize + i - 17;
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
} else
|
||||
state = 0;
|
||||
break;
|
||||
} else {
|
||||
bpc->pc.state64 = 0;
|
||||
goto restart;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found)
|
||||
bpc->pc.frame_start_found++;
|
||||
}
|
||||
@@ -89,7 +94,10 @@ flush:
|
||||
if (ff_combine_frame(&bpc->pc, next, &buf, &buf_size) < 0)
|
||||
return buf_size;
|
||||
|
||||
bpc->pc.frame_start_found = 0;
|
||||
if (next != END_NOT_FOUND && next < 0)
|
||||
bpc->pc.frame_start_found = FFMAX(bpc->pc.frame_start_found - i - 1, 0);
|
||||
else
|
||||
bpc->pc.frame_start_found = 0;
|
||||
|
||||
*poutbuf = buf;
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
@@ -1217,6 +1217,8 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
h->got_keyframe = 1;
|
||||
}
|
||||
case PIC_PB_START_CODE:
|
||||
if (*got_frame)
|
||||
av_frame_unref(data);
|
||||
*got_frame = 0;
|
||||
if (!h->got_keyframe)
|
||||
break;
|
||||
|
||||
@@ -188,7 +188,6 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc
|
||||
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
int i;
|
||||
int16_t (*src)[8] = (int16_t(*)[8])block;
|
||||
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
|
||||
|
||||
src[0][0] += 8;
|
||||
|
||||
@@ -243,14 +242,14 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
const int b2 = a5 - a7;
|
||||
const int b3 = a4 - a6;
|
||||
|
||||
dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
|
||||
dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
|
||||
dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
|
||||
dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
|
||||
dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
|
||||
dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
|
||||
dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
|
||||
dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
|
||||
dst[i + 0*stride] = av_clip_uint8( dst[i + 0*stride] + ((b0 + b4) >> 7));
|
||||
dst[i + 1*stride] = av_clip_uint8( dst[i + 1*stride] + ((b1 + b5) >> 7));
|
||||
dst[i + 2*stride] = av_clip_uint8( dst[i + 2*stride] + ((b2 + b6) >> 7));
|
||||
dst[i + 3*stride] = av_clip_uint8( dst[i + 3*stride] + ((b3 + b7) >> 7));
|
||||
dst[i + 4*stride] = av_clip_uint8( dst[i + 4*stride] + ((b3 - b7) >> 7));
|
||||
dst[i + 5*stride] = av_clip_uint8( dst[i + 5*stride] + ((b2 - b6) >> 7));
|
||||
dst[i + 6*stride] = av_clip_uint8( dst[i + 6*stride] + ((b1 - b5) >> 7));
|
||||
dst[i + 7*stride] = av_clip_uint8( dst[i + 7*stride] + ((b0 - b4) >> 7));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-16
@@ -135,7 +135,8 @@ typedef struct CCaptionSubContext {
|
||||
int64_t last_real_time;
|
||||
char prev_cmd[2];
|
||||
/* buffer to store pkt data */
|
||||
AVBufferRef *pktbuf;
|
||||
uint8_t *pktbuf;
|
||||
int pktbuf_size;
|
||||
} CCaptionSubContext;
|
||||
|
||||
|
||||
@@ -160,11 +161,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
/* allocate pkt buffer */
|
||||
ctx->pktbuf = av_buffer_alloc(128);
|
||||
if (!ctx->pktbuf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -172,7 +169,8 @@ static av_cold int close_decoder(AVCodecContext *avctx)
|
||||
{
|
||||
CCaptionSubContext *ctx = avctx->priv_data;
|
||||
av_bprint_finalize(&ctx->buffer, NULL);
|
||||
av_buffer_unref(&ctx->pktbuf);
|
||||
av_freep(&ctx->pktbuf);
|
||||
ctx->pktbuf_size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -578,16 +576,13 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
if (ctx->pktbuf->size < len) {
|
||||
ret = av_buffer_realloc(&ctx->pktbuf, len);
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n", len, ctx->pktbuf->size);
|
||||
len = ctx->pktbuf->size;
|
||||
ret = 0;
|
||||
}
|
||||
av_fast_padded_malloc(&ctx->pktbuf, &ctx->pktbuf_size, len);
|
||||
if (!ctx->pktbuf) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n", len, ctx->pktbuf_size);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(ctx->pktbuf->data, avpkt->data, len);
|
||||
bptr = ctx->pktbuf->data;
|
||||
memcpy(ctx->pktbuf, avpkt->data, len);
|
||||
bptr = ctx->pktbuf;
|
||||
|
||||
for (i = 0; i < len; i += 3) {
|
||||
uint8_t cc_type = *(bptr + i) & 3;
|
||||
|
||||
+11
-6
@@ -312,7 +312,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[0][0].width = data;
|
||||
s->plane[s->channel_num].band[0][0].stride = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Lowpass width %"PRIu16"\n", data);
|
||||
if (data < 2 || data > s->plane[s->channel_num].band[0][0].a_width) {
|
||||
if (data < 3 || data > s->plane[s->channel_num].band[0][0].a_width) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid lowpass width\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -320,7 +320,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 28) {
|
||||
s->plane[s->channel_num].band[0][0].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Lowpass height %"PRIu16"\n", data);
|
||||
if (data < 2 || data > s->plane[s->channel_num].band[0][0].height) {
|
||||
if (data < 3 || data > s->plane[s->channel_num].band[0][0].height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid lowpass height\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -358,7 +358,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass width %i channel %i level %i subband %i\n", data, s->channel_num, s->level, s->subband_num);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -366,7 +366,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 42) {
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass height %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass height\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -375,7 +375,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass width2 %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass width2\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -383,7 +383,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
} else if (tag == 50) {
|
||||
s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
|
||||
av_log(avctx, AV_LOG_DEBUG, "Highpass height2 %i\n", data);
|
||||
if (data < 2) {
|
||||
if (data < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid highpass height2\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
break;
|
||||
@@ -425,6 +425,11 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
frame.f->width =
|
||||
frame.f->height = 0;
|
||||
|
||||
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -443,10 +443,13 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
if (s->palette_video) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
s->frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1900,9 +1900,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1922,9 +1923,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->x96_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "X96 sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1947,9 +1949,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xxch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XXCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-3
@@ -903,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
|
||||
} else {
|
||||
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
|
||||
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
|
||||
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
slices[slice_num].slice_y = slice_y;
|
||||
@@ -1153,6 +1153,11 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
else {
|
||||
s->num_x = svq3_get_ue_golomb(gb);
|
||||
s->num_y = svq3_get_ue_golomb(gb);
|
||||
if (s->num_x * s->num_y == 0 || s->num_x * (uint64_t)s->num_y > INT_MAX) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
|
||||
s->num_x = s->num_y = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->ld_picture) {
|
||||
s->lowdelay.bytes.num = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.bytes.den = svq3_get_ue_golomb(gb);
|
||||
@@ -1895,7 +1900,9 @@ static int dirac_decode_picture_header(DiracContext *s)
|
||||
for (j = 0; j < MAX_FRAMES; j++)
|
||||
if (!s->all_frames[j].avframe->data[0]) {
|
||||
s->ref_pics[i] = &s->all_frames[j];
|
||||
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
ret = get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -810,7 +810,7 @@ static void compute_default_clut(AVSubtitleRect *rect, int w, int h)
|
||||
list_inv[ i ] = bestv;
|
||||
}
|
||||
|
||||
count = i - 1;
|
||||
count = FFMAX(i - 1, 1);
|
||||
for (i--; i>=0; i--) {
|
||||
int v = i*255/count;
|
||||
AV_WN32(rect->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
|
||||
|
||||
@@ -185,7 +185,7 @@ static void guess_palette(DVDSubContext* ctx,
|
||||
for(i = 0; i < 4; i++) {
|
||||
if (alpha[i] != 0) {
|
||||
if (!color_used[colormap[i]]) {
|
||||
level = level_map[nb_opaque_colors][j];
|
||||
level = level_map[nb_opaque_colors - 1][j];
|
||||
r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
|
||||
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
|
||||
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;
|
||||
@@ -548,7 +548,8 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
||||
{
|
||||
DVDSubContext *ctx = avctx->priv_data;
|
||||
|
||||
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||
av_assert0(buf_size >= 0 && ctx->buf_size <= sizeof(ctx->buf));
|
||||
if (buf_size >= sizeof(ctx->buf) - ctx->buf_size) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||
"too large SPU packets aborted.\n");
|
||||
ctx->buf_size = 0;
|
||||
|
||||
@@ -250,6 +250,10 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
// This codebook can be cut off at places other than
|
||||
// powers of 2, leaving some of the entries undefined.
|
||||
cb_size = get_bits_long(&gb, 20);
|
||||
if (!cb_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid codebook size 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
cb_depth = av_log2(cb_size - 1) + 1;
|
||||
} else {
|
||||
cb_depth = get_bits(&gb, 4);
|
||||
|
||||
@@ -780,14 +780,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
s->colorspace = 1;
|
||||
s->transparency = 1;
|
||||
s->chroma_planes = 1;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_0RGB32:
|
||||
s->colorspace = 1;
|
||||
s->chroma_planes = 1;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_GBRP9:
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
|
||||
@@ -586,10 +586,12 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
temp = curr->next;
|
||||
av_freep(&curr->link_penalty);
|
||||
av_free(curr);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
fpc->headers = fpc->best_header->next;
|
||||
av_freep(&fpc->best_header->link_penalty);
|
||||
av_freep(&fpc->best_header);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
|
||||
/* Find and score new headers. */
|
||||
@@ -617,8 +619,8 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
|
||||
if (!av_fifo_space(fpc->fifo_buf) &&
|
||||
av_fifo_size(fpc->fifo_buf) / FLAC_AVG_FRAME_SIZE >
|
||||
fpc->nb_headers_buffered * 10) {
|
||||
/* There is less than one valid flac header buffered for 10 headers
|
||||
fpc->nb_headers_buffered * 20) {
|
||||
/* There is less than one valid flac header buffered for 20 headers
|
||||
* buffered. Therefore the fifo is most likely filled with invalid
|
||||
* data and the input is not a flac file. */
|
||||
goto handle_error;
|
||||
|
||||
@@ -268,7 +268,8 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
|
||||
int pred_order, int bps)
|
||||
{
|
||||
const int blocksize = s->blocksize;
|
||||
int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i;
|
||||
unsigned av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d);
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
/* warm up samples */
|
||||
@@ -447,7 +448,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
|
||||
if (wasted) {
|
||||
int i;
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
decoded[i] <<= wasted;
|
||||
decoded[i] = (unsigned)decoded[i] << wasted;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -56,7 +56,7 @@ static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
for (i = 0; i < channels; i++)
|
||||
S(samples, i, j) = in[i][j] << shift;
|
||||
S(samples, i, j) = (int)((unsigned)in[i][j] << shift);
|
||||
}
|
||||
|
||||
static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ static int16_t g726_decode(G726Context* c, int I)
|
||||
|
||||
if (I_sig) /* get the sign */
|
||||
dq = -dq;
|
||||
re_signal = c->se + dq;
|
||||
re_signal = (int16_t)(c->se + dq);
|
||||
|
||||
/* Update second order predictor coefficient A2 and A1 */
|
||||
pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
|
||||
|
||||
@@ -382,6 +382,10 @@ static inline uint64_t get_bits64(GetBitContext *s, int n)
|
||||
*/
|
||||
static inline int get_sbits_long(GetBitContext *s, int n)
|
||||
{
|
||||
// sign_extend(x, 0) is undefined
|
||||
if (!n)
|
||||
return 0;
|
||||
|
||||
return sign_extend(get_bits_long(s, n), n);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1656,8 +1656,8 @@ again:
|
||||
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
||||
sl->ref_count[0] = sl->ref_count[1] = sl->list_count = 0;
|
||||
} else if (err == SLICE_SINGLETHREAD) {
|
||||
if (context_count > 1) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count - 1);
|
||||
if (context_count > 0) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count);
|
||||
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
goto end;
|
||||
context_count = 0;
|
||||
|
||||
@@ -3149,6 +3149,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
|
||||
s->context_initialized = 1;
|
||||
s->eos = 0;
|
||||
|
||||
ff_hevc_reset_sei(s);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
||||
@@ -1092,6 +1092,15 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
||||
uint8_t *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Reset SEI values that are stored on the Context.
|
||||
* e.g. Caption data that was extracted during NAL
|
||||
* parsing.
|
||||
*
|
||||
* @param s HEVCContext.
|
||||
*/
|
||||
void ff_hevc_reset_sei(HEVCContext *s);
|
||||
|
||||
extern const uint8_t ff_hevc_qpel_extra_before[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra_after[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra[4];
|
||||
|
||||
@@ -209,6 +209,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
|
||||
|
||||
h->avctx = avctx;
|
||||
|
||||
ff_hevc_reset_sei(h);
|
||||
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -373,3 +373,9 @@ int ff_hevc_decode_nal_sei(HEVCContext *s)
|
||||
} while (more_rbsp_data(&s->HEVClc->gb));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ff_hevc_reset_sei(HEVCContext *s)
|
||||
{
|
||||
s->a53_caption_size = 0;
|
||||
av_freep(&s->a53_caption);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,8 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
IdcinContext *s = avctx->priv_data;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
@@ -227,9 +228,11 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
if (idcin_decode_vlcs(s, frame))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (pal) {
|
||||
if (pal && pal_size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
}
|
||||
/* make the palette available on the way out */
|
||||
memcpy(frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||
|
||||
@@ -171,6 +171,12 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
ltab = buf[0x22] & 3;
|
||||
ctab = buf[0x22] >> 2;
|
||||
|
||||
if (ctab > 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "ctab %d is invalid\n", ctab);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (s->decode_delta) { /* intraframe */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
|
||||
@@ -293,6 +293,8 @@ const uint8_t *avpriv_find_start_code(const uint8_t *p,
|
||||
const uint8_t *end,
|
||||
uint32_t *state);
|
||||
|
||||
int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec);
|
||||
|
||||
/**
|
||||
* Check that the provided frame dimensions are valid and set them on the codec
|
||||
* context.
|
||||
|
||||
@@ -61,6 +61,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
if (avctx->extradata_size < 14)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (avctx->channels <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", avctx->channels);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->level = AV_RL16(avctx->extradata + 12) & 0xf;
|
||||
s->rows = AV_RL16(avctx->extradata + 12) >> 4;
|
||||
s->cols = 1 << s->level;
|
||||
@@ -71,7 +76,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
s->block = av_calloc(s->block_len, sizeof(int));
|
||||
s->wrapbuf = av_calloc(s->wrapbuf_len, sizeof(int));
|
||||
s->ampbuf = av_calloc(0x10000, sizeof(int));
|
||||
s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream));
|
||||
s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE / sizeof(*s->bitstream) + 1, sizeof(*s->bitstream));
|
||||
if (!s->block || !s->wrapbuf || !s->ampbuf || !s->bitstream)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -325,6 +330,10 @@ static int t15(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 3) + (x3 * 9) */
|
||||
b = get_bits(gb, 5);
|
||||
if (b > 26) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 26\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_3x3[b] & 0x0F) - 1;
|
||||
n2 = ((mul_3x3[b] >> 4) & 0x0F) - 1;
|
||||
@@ -350,6 +359,10 @@ static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 5) + (x3 * 25) */
|
||||
b = get_bits(gb, 7);
|
||||
if (b > 124) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 124\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_3x5[b] & 0x0F) - 2;
|
||||
n2 = ((mul_3x5[b] >> 4) & 0x0F) - 2;
|
||||
@@ -374,6 +387,10 @@ static int t37(InterplayACMContext *s, unsigned ind, unsigned col)
|
||||
for (i = 0; i < s->rows; i++) {
|
||||
/* b = (x1) + (x2 * 11) */
|
||||
b = get_bits(gb, 7);
|
||||
if (b > 120) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 120\n", b);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
n1 = (mul_2x11[b] & 0x0F) - 5;
|
||||
n2 = ((mul_2x11[b] >> 4) & 0x0F) - 5;
|
||||
|
||||
@@ -1012,10 +1012,13 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
if (!s->is_16bpp) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ static int h263_decode_gob_header(MpegEncContext *s)
|
||||
/* We have a GBSC probably with GSTUFF */
|
||||
skip_bits(&s->gb, 16); /* Drop the zeros */
|
||||
left= get_bits_left(&s->gb);
|
||||
left = FFMIN(left, 32);
|
||||
//MN: we must check the bits left or we might end in a infinite loop (or segfault)
|
||||
for(;left>13; left--){
|
||||
if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
|
||||
|
||||
+5
-2
@@ -268,7 +268,8 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
|
||||
int i, ret;
|
||||
int header;
|
||||
int blocksize;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
|
||||
|
||||
bytestream2_init(&ctx->g, avpkt->data, avpkt->size);
|
||||
|
||||
@@ -303,9 +304,11 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
|
||||
}
|
||||
}
|
||||
|
||||
if (pal) {
|
||||
if (pal && pal_size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(ctx->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
}
|
||||
|
||||
if (ctx->setpal) {
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
* JPEG 2000 decoder using libopenjpeg
|
||||
*/
|
||||
|
||||
#define OPJ_STATIC
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
|
||||
+45
-22
@@ -24,8 +24,6 @@
|
||||
* JPEG 2000 encoder using libopenjpeg
|
||||
*/
|
||||
|
||||
#define OPJ_STATIC
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
@@ -54,7 +52,9 @@
|
||||
|
||||
typedef struct LibOpenJPEGContext {
|
||||
AVClass *avclass;
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
opj_image_t *image;
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 1
|
||||
opj_cparameters_t enc_params;
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
opj_event_mgr_t event_mgr;
|
||||
@@ -352,6 +352,12 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
|
||||
ctx->enc_params.cp_cinema = ctx->cinema_mode;
|
||||
#endif
|
||||
|
||||
if (!ctx->numresolution) {
|
||||
ctx->numresolution = 6;
|
||||
while (FFMIN(avctx->width, avctx->height) >> ctx->numresolution < 1)
|
||||
ctx->numresolution --;
|
||||
}
|
||||
|
||||
ctx->enc_params.mode = !!avctx->global_quality;
|
||||
ctx->enc_params.prog_order = ctx->prog_order;
|
||||
ctx->enc_params.numresolution = ctx->numresolution;
|
||||
@@ -365,18 +371,22 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
|
||||
cinema_parameters(&ctx->enc_params);
|
||||
}
|
||||
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
ctx->image = mj2_create_image(avctx, &ctx->enc_params);
|
||||
if (!ctx->image) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n");
|
||||
err = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 1
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
opj_image_destroy(ctx->image);
|
||||
ctx->image = NULL;
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 1
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -411,7 +421,7 @@ static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame,
|
||||
for (; y < image->comps[compno].h; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
for (x = 0; x < image->comps[compno].w; ++x) {
|
||||
image_line[x] = image_line[x - image->comps[compno].w];
|
||||
image_line[x] = image_line[x - (int)image->comps[compno].w];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -451,7 +461,7 @@ static int libopenjpeg_copy_packed12(AVCodecContext *avctx, const AVFrame *frame
|
||||
for (; y < image->comps[compno].h; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
for (x = 0; x < image->comps[compno].w; ++x) {
|
||||
image_line[x] = image_line[x - image->comps[compno].w];
|
||||
image_line[x] = image_line[x - (int)image->comps[compno].w];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -491,7 +501,7 @@ static int libopenjpeg_copy_packed16(AVCodecContext *avctx, const AVFrame *frame
|
||||
for (; y < image->comps[compno].h; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
for (x = 0; x < image->comps[compno].w; ++x) {
|
||||
image_line[x] = image_line[x - image->comps[compno].w];
|
||||
image_line[x] = image_line[x - (int)image->comps[compno].w];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -518,8 +528,8 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
|
||||
}
|
||||
|
||||
for (compno = 0; compno < numcomps; ++compno) {
|
||||
width = avctx->width / image->comps[compno].dx;
|
||||
height = avctx->height / image->comps[compno].dy;
|
||||
width = (avctx->width + image->comps[compno].dx - 1) / image->comps[compno].dx;
|
||||
height = (avctx->height + image->comps[compno].dy - 1) / image->comps[compno].dy;
|
||||
for (y = 0; y < height; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
frame_index = y * frame->linesize[compno];
|
||||
@@ -532,7 +542,7 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
|
||||
for (; y < image->comps[compno].h; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
for (x = 0; x < image->comps[compno].w; ++x) {
|
||||
image_line[x] = image_line[x - image->comps[compno].w];
|
||||
image_line[x] = image_line[x - (int)image->comps[compno].w];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,8 +570,8 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
|
||||
}
|
||||
|
||||
for (compno = 0; compno < numcomps; ++compno) {
|
||||
width = avctx->width / image->comps[compno].dx;
|
||||
height = avctx->height / image->comps[compno].dy;
|
||||
width = (avctx->width + image->comps[compno].dx - 1) / image->comps[compno].dx;
|
||||
height = (avctx->height + image->comps[compno].dy - 1) / image->comps[compno].dy;
|
||||
frame_ptr = (uint16_t *)frame->data[compno];
|
||||
for (y = 0; y < height; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
@@ -575,7 +585,7 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
|
||||
for (; y < image->comps[compno].h; ++y) {
|
||||
image_line = image->comps[compno].data + y * image->comps[compno].w;
|
||||
for (x = 0; x < image->comps[compno].w; ++x) {
|
||||
image_line[x] = image_line[x - image->comps[compno].w];
|
||||
image_line[x] = image_line[x - (int)image->comps[compno].w];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -587,18 +597,24 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
const AVFrame *frame, int *got_packet)
|
||||
{
|
||||
LibOpenJPEGContext *ctx = avctx->priv_data;
|
||||
opj_image_t *image = ctx->image;
|
||||
int ret;
|
||||
AVFrame *gbrframe;
|
||||
int cpyresult = 0;
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
opj_image_t *image = ctx->image;
|
||||
opj_cinfo_t *compress = NULL;
|
||||
opj_cio_t *stream = NULL;
|
||||
int len;
|
||||
#else // OPENJPEG_MAJOR_VERSION == 2
|
||||
opj_codec_t *compress = NULL;
|
||||
opj_stream_t *stream = NULL;
|
||||
opj_image_t *image = mj2_create_image(avctx, &ctx->enc_params);
|
||||
if (!image) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto done;
|
||||
}
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 1
|
||||
int cpyresult = 0;
|
||||
int ret;
|
||||
AVFrame *gbrframe;
|
||||
|
||||
switch (avctx->pix_fmt) {
|
||||
case AV_PIX_FMT_RGB24:
|
||||
@@ -621,8 +637,10 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
case AV_PIX_FMT_GBRP14:
|
||||
case AV_PIX_FMT_GBRP16:
|
||||
gbrframe = av_frame_clone(frame);
|
||||
if (!gbrframe)
|
||||
return AVERROR(ENOMEM);
|
||||
if (!gbrframe) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto done;
|
||||
}
|
||||
gbrframe->data[0] = frame->data[2]; // swap to be rgb
|
||||
gbrframe->data[1] = frame->data[0];
|
||||
gbrframe->data[2] = frame->data[1];
|
||||
@@ -679,19 +697,21 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"The frame's pixel format '%s' is not supported\n",
|
||||
av_get_pix_fmt_name(avctx->pix_fmt));
|
||||
return AVERROR(EINVAL);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto done;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!cpyresult) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Could not copy the frame data to the internal image buffer\n");
|
||||
return -1;
|
||||
ret = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
#if OPENJPEG_MAJOR_VERSION == 2
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, 1024, 0)) < 0) {
|
||||
return ret;
|
||||
goto done;
|
||||
}
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 2
|
||||
|
||||
@@ -758,7 +778,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
#error Missing call to opj_stream_set_user_data
|
||||
#endif
|
||||
|
||||
if (!opj_start_compress(compress, ctx->image, stream) ||
|
||||
if (!opj_start_compress(compress, image, stream) ||
|
||||
!opj_encode(compress, stream) ||
|
||||
!opj_end_compress(compress, stream)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error during the opj encode\n");
|
||||
@@ -777,6 +797,7 @@ done:
|
||||
#if OPENJPEG_MAJOR_VERSION == 2
|
||||
opj_stream_destroy(stream);
|
||||
opj_destroy_codec(compress);
|
||||
opj_image_destroy(image);
|
||||
#else
|
||||
opj_cio_close(stream);
|
||||
opj_destroy_compress(compress);
|
||||
@@ -786,10 +807,12 @@ done:
|
||||
|
||||
static av_cold int libopenjpeg_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
#if OPENJPEG_MAJOR_VERSION == 1
|
||||
LibOpenJPEGContext *ctx = avctx->priv_data;
|
||||
|
||||
opj_image_destroy(ctx->image);
|
||||
ctx->image = NULL;
|
||||
#endif // OPENJPEG_MAJOR_VERSION == 1
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -814,7 +837,7 @@ static const AVOption options[] = {
|
||||
{ "rpcl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(RPCL) }, 0, 0, VE, "prog_order" },
|
||||
{ "pcrl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(PCRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "cprl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(CPRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 6 }, 1, INT_MAX, VE },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||
{ "numlayers", NULL, OFFSET(numlayers), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 10, VE },
|
||||
{ "disto_alloc", NULL, OFFSET(disto_alloc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
|
||||
{ "fixed_alloc", NULL, OFFSET(fixed_alloc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
|
||||
|
||||
@@ -47,6 +47,13 @@ static av_cold int libopus_decode_init(AVCodecContext *avc)
|
||||
int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
|
||||
uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
|
||||
|
||||
avc->channels = avc->extradata_size >= 10 ? avc->extradata[9] : (avc->channels == 1) ? 1 : 2;
|
||||
if (avc->channels <= 0) {
|
||||
av_log(avc, AV_LOG_WARNING,
|
||||
"Invalid number of channels %d, defaulting to stereo\n", avc->channels);
|
||||
avc->channels = 2;
|
||||
}
|
||||
|
||||
avc->sample_rate = 48000;
|
||||
avc->sample_fmt = avc->request_sample_fmt == AV_SAMPLE_FMT_FLT ?
|
||||
AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_S16;
|
||||
|
||||
@@ -218,6 +218,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
|
||||
int outer = 1;
|
||||
SchroParseUnitContext parse_ctx;
|
||||
LibSchroFrameContext *framewithpts = NULL;
|
||||
int ret;
|
||||
|
||||
*got_frame = 0;
|
||||
|
||||
@@ -307,11 +308,10 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
|
||||
/* Grab next frame to be returned from the top of the queue. */
|
||||
framewithpts = ff_schro_queue_pop(&p_schro_params->dec_frame_queue);
|
||||
|
||||
if (framewithpts && framewithpts->frame) {
|
||||
int ret;
|
||||
if (framewithpts && framewithpts->frame && framewithpts->frame->components[0].stride) {
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, avframe, 0)) < 0)
|
||||
return ret;
|
||||
goto end;
|
||||
|
||||
memcpy(avframe->data[0],
|
||||
framewithpts->frame->components[0].data,
|
||||
@@ -332,15 +332,17 @@ static int libschroedinger_decode_frame(AVCodecContext *avctx,
|
||||
avframe->linesize[2] = framewithpts->frame->components[2].stride;
|
||||
|
||||
*got_frame = 1;
|
||||
|
||||
/* Now free the frame resources. */
|
||||
libschroedinger_decode_frame_free(framewithpts->frame);
|
||||
av_free(framewithpts);
|
||||
} else {
|
||||
data = NULL;
|
||||
*got_frame = 0;
|
||||
}
|
||||
return buf_size;
|
||||
ret = buf_size;
|
||||
end:
|
||||
/* Now free the frame resources. */
|
||||
if (framewithpts && framewithpts->frame)
|
||||
libschroedinger_decode_frame_free(framewithpts->frame);
|
||||
av_freep(&framewithpts);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -783,8 +783,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
if(x4->x264opts){
|
||||
const char *p= x4->x264opts;
|
||||
while(p){
|
||||
char param[256]={0}, val[256]={0};
|
||||
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
|
||||
char param[4096]={0}, val[4096]={0};
|
||||
if(sscanf(p, "%4095[^:=]=%4095[^:]", param, val) == 1){
|
||||
OPT_STR(param, "1");
|
||||
}else
|
||||
OPT_STR(param, val);
|
||||
|
||||
@@ -53,6 +53,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
|
||||
ret = av_reallocp(buf, *size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
p = *buf + len;
|
||||
}
|
||||
|
||||
bytestream2_get_buffer(gb, p, s);
|
||||
@@ -75,6 +76,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
|
||||
ret = av_reallocp(buf, *size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
p = *buf + len;
|
||||
}
|
||||
|
||||
av_memcpy_backptr(p, off, l);
|
||||
|
||||
+40
-18
@@ -1369,11 +1369,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
int mb_x, mb_y;
|
||||
int EOBRUN = 0;
|
||||
int c = s->comp_index[0];
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int last_scan = 0;
|
||||
int16_t *quant_matrix = s->quant_matrixes[s->quant_sindex[0]];
|
||||
int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
|
||||
av_assert0(ss>=0 && Ah>=0 && Al>=0);
|
||||
if (se < ss || se > 63) {
|
||||
@@ -1384,15 +1380,10 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
// s->coefs_finished is a bitmask for coefficients coded
|
||||
// ss and se are parameters telling start and end coefficients
|
||||
s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
|
||||
last_scan = !Al && !~s->coefs_finished[c];
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
|
||||
s->restart_count = 0;
|
||||
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
uint8_t *last_nnz = &s->last_nnz[c][block_idx];
|
||||
@@ -1413,12 +1404,6 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (last_scan) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
if (handle_rstn(s, 0))
|
||||
EOBRUN = 0;
|
||||
}
|
||||
@@ -1426,6 +1411,41 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mjpeg_idct_scan_progressive_ac(MJpegDecodeContext *s)
|
||||
{
|
||||
int mb_x, mb_y;
|
||||
int c;
|
||||
const int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
const int block_size = s->lossless ? 1 : 8;
|
||||
|
||||
for (c = 0; c < s->nb_components; c++) {
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int h = s->h_max / s->h_count[c];
|
||||
int v = s->v_max / s->v_count[c];
|
||||
int mb_width = (s->width + h * block_size - 1) / (h * block_size);
|
||||
int mb_height = (s->height + v * block_size - 1) / (v * block_size);
|
||||
|
||||
if (~s->coefs_finished[c])
|
||||
av_log(s->avctx, AV_LOG_WARNING, "component %d is incomplete\n", c);
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
for (mb_x = 0; mb_x < mb_width; mb_x++, block++) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
|
||||
int mb_bitmask_size, const AVFrame *reference)
|
||||
{
|
||||
@@ -2084,6 +2104,9 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
/* Comment */
|
||||
else if (start_code == COM)
|
||||
mjpeg_decode_com(s);
|
||||
else if (start_code == DQT) {
|
||||
ff_mjpeg_decode_dqt(s);
|
||||
}
|
||||
|
||||
ret = -1;
|
||||
|
||||
@@ -2115,9 +2138,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
s->restart_count = 0;
|
||||
/* nothing to do on SOI */
|
||||
break;
|
||||
case DQT:
|
||||
ff_mjpeg_decode_dqt(s);
|
||||
break;
|
||||
case DHT:
|
||||
if ((ret = ff_mjpeg_decode_dht(s)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "huffman table decode error\n");
|
||||
@@ -2162,6 +2182,8 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
break;
|
||||
case EOI:
|
||||
eoi_parser:
|
||||
if (avctx->skip_frame != AVDISCARD_ALL && s->progressive && s->cur_scan && s->got_picture)
|
||||
mjpeg_idct_scan_progressive_ac(s);
|
||||
s->cur_scan = 0;
|
||||
if (!s->got_picture) {
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
|
||||
@@ -487,7 +487,12 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
|
||||
m->size_var = 8;
|
||||
//size_var is equal to 8 or 16 depending on the size of box
|
||||
|
||||
if (m->tracksize + tsmb_size > avpkt->size)
|
||||
if (tsmb_size == 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "tsmb_size is 0\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (tsmb_size > avpkt->size - m->tracksize)
|
||||
break;
|
||||
|
||||
for (size_t i = 0; i < box_count; i++) {
|
||||
|
||||
+6
-2
@@ -415,10 +415,14 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
|
||||
c->cur_frame++;
|
||||
|
||||
c->last_bits_used = get_bits_count(gb);
|
||||
if(get_bits_left(gb) < 8) // we have only padding left
|
||||
c->last_bits_used = buf_size << 3;
|
||||
if(c->cur_frame >= c->frames)
|
||||
c->cur_frame = 0;
|
||||
if(c->cur_frame == 0 && get_bits_left(gb) < 8) {// we have only padding left
|
||||
c->last_bits_used = buf_size << 3;
|
||||
} else if (get_bits_left(gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
|
||||
c->last_bits_used = buf_size << 3;
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
|
||||
@@ -2432,7 +2432,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
s->closed_gop = get_bits1(&s->gb);
|
||||
/* broken_link indicate that after editing the
|
||||
/* broken_link indicates that after editing the
|
||||
* reference frames of the first B-Frames after GOP I-Frame
|
||||
* are missing (open gop) */
|
||||
broken_link = get_bits1(&s->gb);
|
||||
@@ -2827,6 +2827,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
|
||||
avctx->extradata, avctx->extradata_size);
|
||||
if (*got_output) {
|
||||
av_log(avctx, AV_LOG_ERROR, "picture in extradata\n");
|
||||
av_frame_unref(picture);
|
||||
*got_output = 0;
|
||||
}
|
||||
s->extradata_decoded = 1;
|
||||
|
||||
@@ -98,7 +98,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||
} else if (codec_id == AV_CODEC_ID_MP3ADU) {
|
||||
avpriv_report_missing_feature(avctx,
|
||||
"MP3ADU full parser");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
return 0; /* parsers must not return error codes */
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -822,9 +822,7 @@ static void clear_context(MpegEncContext *s)
|
||||
s->sc.b_scratchpad =
|
||||
s->sc.obmc_scratchpad = NULL;
|
||||
|
||||
s->parse_context.buffer = NULL;
|
||||
s->parse_context.buffer_size = 0;
|
||||
s->parse_context.overread = 0;
|
||||
|
||||
s->bitstream_buffer = NULL;
|
||||
s->allocated_bitstream_buffer_size = 0;
|
||||
s->picture = NULL;
|
||||
@@ -1216,6 +1214,8 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
ff_mpeg_unref_picture(s->avctx, &s->current_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
|
||||
/* release non reference frames */
|
||||
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
|
||||
@@ -1367,14 +1367,12 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data));
|
||||
#endif
|
||||
if (s->last_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
if (s->last_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture,
|
||||
s->last_picture_ptr)) < 0)
|
||||
return ret;
|
||||
}
|
||||
if (s->next_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
if (s->next_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->next_picture,
|
||||
s->next_picture_ptr)) < 0)
|
||||
|
||||
@@ -2912,6 +2912,8 @@ int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t s
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
emms_c();
|
||||
|
||||
av_fast_padded_malloc(&new_buffer, &new_buffer_size,
|
||||
s->avctx->internal->byte_buffer_size + size_increase);
|
||||
if (!new_buffer)
|
||||
|
||||
+5
-2
@@ -99,11 +99,14 @@ static int msrle_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
|
||||
if (pal) {
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
s->frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
/* make the palette available */
|
||||
memcpy(s->frame->data[1], s->pal, AVPALETTE_SIZE);
|
||||
|
||||
+7
-1
@@ -422,7 +422,13 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
|
||||
|
||||
ff_vc1_decode_blocks(v);
|
||||
|
||||
ff_er_frame_end(&s->er);
|
||||
if (v->end_mb_x == s->mb_width && s->end_mb_y == s->mb_height) {
|
||||
ff_er_frame_end(&s->er);
|
||||
} else {
|
||||
av_log(v->s.avctx, AV_LOG_WARNING,
|
||||
"disabling error correction due to block count mismatch %dx%d != %dx%d\n",
|
||||
v->end_mb_x, s->end_mb_y, s->mb_width, s->mb_height);
|
||||
}
|
||||
|
||||
ff_mpv_frame_end(s);
|
||||
|
||||
|
||||
@@ -306,11 +306,14 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
if (s->mode_8bit) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
|
||||
if (pal) {
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
s->frame->palette_has_changed = 1;
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -558,12 +558,13 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
|
||||
|
||||
sub->rects[i]->x = ctx->presentation.objects[i].x;
|
||||
sub->rects[i]->y = ctx->presentation.objects[i].y;
|
||||
sub->rects[i]->w = object->w;
|
||||
sub->rects[i]->h = object->h;
|
||||
|
||||
sub->rects[i]->linesize[0] = object->w;
|
||||
|
||||
if (object->rle) {
|
||||
sub->rects[i]->w = object->w;
|
||||
sub->rects[i]->h = object->h;
|
||||
|
||||
sub->rects[i]->linesize[0] = object->w;
|
||||
|
||||
if (object->rle_remaining_len) {
|
||||
av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
|
||||
object->rle_data_len, object->rle_remaining_len);
|
||||
|
||||
+7
-3
@@ -43,7 +43,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int buf_size = avpkt->size;
|
||||
PNMContext * const s = avctx->priv_data;
|
||||
AVFrame * const p = data;
|
||||
int i, j, n, linesize, h, upgrade = 0, is_mono = 0;
|
||||
int i, j, k, n, linesize, h, upgrade = 0, is_mono = 0;
|
||||
unsigned char *ptr;
|
||||
int components, sample_len, ret;
|
||||
|
||||
@@ -143,10 +143,14 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
v = (*s->bytestream++)&1;
|
||||
} else {
|
||||
/* read a sequence of digits */
|
||||
do {
|
||||
for (k = 0; k < 5 && c <= 9; k += 1) {
|
||||
v = 10*v + c;
|
||||
c = (*s->bytestream++) - '0';
|
||||
} while (c <= 9);
|
||||
}
|
||||
if (v > s->maxval) {
|
||||
av_log(avctx, AV_LOG_ERROR, "value %d larger than maxval %d\n", v, s->maxval);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
if (sample_len == 16) {
|
||||
((uint16_t*)ptr)[j] = (((1<<sample_len)-1)*v + (s->maxval>>1))/s->maxval;
|
||||
|
||||
@@ -67,10 +67,10 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
int i;
|
||||
vec_u8 perm = vec_lvsl(0, pixels);
|
||||
const vec_u8 zero = (const vec_u8)vec_splat_u8(0);
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
vec_u8 perm = vec_lvsl(0, pixels);
|
||||
/* Read potentially unaligned pixels.
|
||||
* We're reading 16 pixels, and actually only want 8,
|
||||
* but we simply ignore the extras. */
|
||||
@@ -157,8 +157,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
|
||||
const uint8_t *s2, int stride)
|
||||
{
|
||||
int i;
|
||||
vec_u8 perm1 = vec_lvsl(0, s1);
|
||||
vec_u8 perm2 = vec_lvsl(0, s2);
|
||||
vec_u8 perm;
|
||||
const vec_u8 zero = (const vec_u8)vec_splat_u8(0);
|
||||
vec_s16 shorts1, shorts2;
|
||||
|
||||
@@ -166,17 +165,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
|
||||
/* Read potentially unaligned pixels.
|
||||
* We're reading 16 pixels, and actually only want 8,
|
||||
* but we simply ignore the extras. */
|
||||
perm = vec_lvsl(0, s1);
|
||||
vec_u8 pixl = vec_ld(0, s1);
|
||||
vec_u8 pixr = vec_ld(15, s1);
|
||||
vec_u8 bytes = vec_perm(pixl, pixr, perm1);
|
||||
vec_u8 bytes = vec_perm(pixl, pixr, perm);
|
||||
|
||||
// Convert the bytes into shorts.
|
||||
shorts1 = (vec_s16)vec_mergeh(zero, bytes);
|
||||
|
||||
// Do the same for the second block of pixels.
|
||||
perm = vec_lvsl(0, s2);
|
||||
pixl = vec_ld(0, s2);
|
||||
pixr = vec_ld(15, s2);
|
||||
bytes = vec_perm(pixl, pixr, perm2);
|
||||
bytes = vec_perm(pixl, pixr, perm);
|
||||
|
||||
// Convert the bytes into shorts.
|
||||
shorts2 = (vec_s16)vec_mergeh(zero, bytes);
|
||||
@@ -197,17 +198,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
|
||||
/* Read potentially unaligned pixels.
|
||||
* We're reading 16 pixels, and actually only want 8,
|
||||
* but we simply ignore the extras. */
|
||||
perm = vec_lvsl(0, s1);
|
||||
pixl = vec_ld(0, s1);
|
||||
pixr = vec_ld(15, s1);
|
||||
bytes = vec_perm(pixl, pixr, perm1);
|
||||
bytes = vec_perm(pixl, pixr, perm);
|
||||
|
||||
// Convert the bytes into shorts.
|
||||
shorts1 = (vec_s16)vec_mergeh(zero, bytes);
|
||||
|
||||
// Do the same for the second block of pixels.
|
||||
perm = vec_lvsl(0, s2);
|
||||
pixl = vec_ld(0, s2);
|
||||
pixr = vec_ld(15, s2);
|
||||
bytes = vec_perm(pixl, pixr, perm2);
|
||||
bytes = vec_perm(pixl, pixr, perm);
|
||||
|
||||
// Convert the bytes into shorts.
|
||||
shorts2 = (vec_s16)vec_mergeh(zero, bytes);
|
||||
|
||||
@@ -625,7 +625,7 @@ static int decode_slice(AVCodecContext *avctx, void *tdata)
|
||||
|
||||
/* if V or alpha component size is negative that means that previous
|
||||
component sizes are too large */
|
||||
if (v_data_size < 0 || a_data_size < 0 || hdr_size < 6) {
|
||||
if (v_data_size < 0 || a_data_size < 0 || hdr_size < 6 || coff[3] > slice_data_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid data size\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
+5
-2
@@ -260,7 +260,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
AVFrame * const ref = a->ref;
|
||||
uint8_t* outdata;
|
||||
int delta, ret;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
|
||||
|
||||
if (avpkt->size < 0x86) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
|
||||
@@ -287,9 +288,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* make the palette available on the way out */
|
||||
if (pal) {
|
||||
if (pal && pal_size == AVPALETTE_SIZE) {
|
||||
p->palette_has_changed = 1;
|
||||
memcpy(a->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
}
|
||||
memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
|
||||
|
||||
|
||||
+5
-2
@@ -506,11 +506,14 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if(has_palette) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
|
||||
if (pal) {
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
s->frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
|
||||
/* make the palette available on the way out */
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
const PixelFormatTag ff_raw_pix_fmt_tags[] = {
|
||||
{ AV_PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
|
||||
{ AV_PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
|
||||
{ AV_PIX_FMT_YUV420P, MKTAG('y', 'v', '1', '2') },
|
||||
{ AV_PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
|
||||
{ AV_PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
|
||||
{ AV_PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
|
||||
|
||||
+9
-3
@@ -223,8 +223,9 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
}
|
||||
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
|
||||
if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4
|
||||
|| avctx->bits_per_coded_sample <= 2) &&
|
||||
if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4 ||
|
||||
avctx->bits_per_coded_sample == 2 || avctx->bits_per_coded_sample == 1 ||
|
||||
(avctx->bits_per_coded_sample == 0 && (context->is_nut_pal8 || context->is_mono)) ) &&
|
||||
(context->is_mono || context->is_pal8) &&
|
||||
(!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' ') ||
|
||||
context->is_nut_mono || context->is_nut_pal8)) {
|
||||
@@ -382,8 +383,13 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
}
|
||||
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
&pal_size);
|
||||
if (pal && pal_size != AVPALETTE_SIZE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
pal = NULL;
|
||||
}
|
||||
|
||||
if (pal) {
|
||||
av_buffer_unref(&context->palette);
|
||||
|
||||
@@ -223,6 +223,12 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
ff_dlog(avctx, "pixel_size %d packed_size %d.\n", pixel_size, packed_size);
|
||||
|
||||
if (packed_size < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid tile size %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Get pixels buffer, it may be deflated or just raw */
|
||||
if (pixel_size == packed_size) {
|
||||
if (bytestream2_get_bytes_left(gbc) < pixel_size) {
|
||||
@@ -233,6 +239,11 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pixels = gbc->buffer;
|
||||
} else {
|
||||
uLongf len = ctx->inflated_size;
|
||||
if (bytestream2_get_bytes_left(gbc) < packed_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
ret = uncompress(ctx->inflated_buf, &len, gbc->buffer, packed_size);
|
||||
if (ret) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Pixel deflate error %d.\n", ret);
|
||||
|
||||
@@ -109,6 +109,8 @@ static int get_dimension(GetBitContext *gb, const int *dim)
|
||||
val = dim[get_bits1(gb) - val];
|
||||
if(!val){
|
||||
do{
|
||||
if (get_bits_left(gb) < 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
t = get_bits(gb, 8);
|
||||
val += t << 2;
|
||||
}while(t == 0xFF);
|
||||
|
||||
@@ -131,8 +131,12 @@ static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t pref
|
||||
/**
|
||||
* Decode header tree
|
||||
*/
|
||||
static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx)
|
||||
static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx, int length)
|
||||
{
|
||||
if(length > 500) { // Larger length can cause segmentation faults due to too deep recursion.
|
||||
av_log(NULL, AV_LOG_ERROR, "length too long\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (hc->current + 1 >= hc->length) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -161,12 +165,12 @@ static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx
|
||||
int r = 0, r_new, t;
|
||||
|
||||
t = hc->current++;
|
||||
r = smacker_decode_bigtree(gb, hc, ctx);
|
||||
r = smacker_decode_bigtree(gb, hc, ctx, length + 1);
|
||||
if(r < 0)
|
||||
return r;
|
||||
hc->values[t] = SMK_NODE | r;
|
||||
r++;
|
||||
r_new = smacker_decode_bigtree(gb, hc, ctx);
|
||||
r_new = smacker_decode_bigtree(gb, hc, ctx, length + 1);
|
||||
if (r_new < 0)
|
||||
return r_new;
|
||||
return r + r_new;
|
||||
@@ -277,7 +281,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (smacker_decode_bigtree(gb, &huff, &ctx) < 0)
|
||||
if (smacker_decode_bigtree(gb, &huff, &ctx, 0) < 0)
|
||||
err = -1;
|
||||
skip_bits1(gb);
|
||||
if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
|
||||
|
||||
@@ -152,6 +152,10 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
|
||||
|
||||
cur_frame = avpkt->pts % s->frames_per_jpeg;
|
||||
|
||||
/* cur_frame is later used to calculate the buffer offset, so it mustn't be negative */
|
||||
if (cur_frame < 0)
|
||||
cur_frame += s->frames_per_jpeg;
|
||||
|
||||
/* Are we at the start of a block? */
|
||||
if (!cur_frame) {
|
||||
av_frame_unref(mjpeg_data);
|
||||
|
||||
@@ -168,7 +168,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
} else {
|
||||
for (y = 0; y < h; y++) {
|
||||
if (buf_end - buf < len)
|
||||
if (buf_end - buf < alen)
|
||||
break;
|
||||
memcpy(ptr, buf, len);
|
||||
ptr += stride;
|
||||
|
||||
+5
-2
@@ -99,11 +99,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
|
||||
/* make the palette available on the way out */
|
||||
if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
|
||||
if (pal) {
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
+7
-1
@@ -957,6 +957,7 @@ int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, v
|
||||
if (ret)
|
||||
ret[i] = r;
|
||||
}
|
||||
emms_c();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -969,6 +970,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
|
||||
if (ret)
|
||||
ret[i] = r;
|
||||
}
|
||||
emms_c();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1126,6 +1128,10 @@ int av_codec_get_max_lowres(const AVCodec *codec)
|
||||
return codec->max_lowres;
|
||||
}
|
||||
|
||||
int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){
|
||||
return !!(codec->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM);
|
||||
}
|
||||
|
||||
static void get_subtitle_defaults(AVSubtitle *sub)
|
||||
{
|
||||
memset(sub, 0, sizeof(*sub));
|
||||
@@ -2254,7 +2260,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
||||
skip_reason = AV_RL8(side + 8);
|
||||
discard_reason = AV_RL8(side + 9);
|
||||
}
|
||||
if (avctx->internal->skip_samples && *got_frame_ptr &&
|
||||
if (avctx->internal->skip_samples > 0 && *got_frame_ptr &&
|
||||
!(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
|
||||
if(frame->nb_samples <= avctx->internal->skip_samples){
|
||||
*got_frame_ptr = 0;
|
||||
|
||||
+2
-3
@@ -3703,11 +3703,10 @@ static av_always_inline void adapt_prob(uint8_t *p, unsigned ct0, unsigned ct1,
|
||||
if (!ct)
|
||||
return;
|
||||
|
||||
update_factor = FASTDIV(update_factor * FFMIN(ct, max_count), max_count);
|
||||
p1 = *p;
|
||||
p2 = ((ct0 << 8) + (ct >> 1)) / ct;
|
||||
p2 = ((((int64_t) ct0) << 8) + (ct >> 1)) / ct;
|
||||
p2 = av_clip(p2, 1, 255);
|
||||
ct = FFMIN(ct, max_count);
|
||||
update_factor = FASTDIV(update_factor * ct, max_count);
|
||||
|
||||
// (p1 * (256 - update_factor) + p2 * update_factor + 128) >> 8
|
||||
*p = p1 + (((p2 - p1) * update_factor + 128) >> 8);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
typedef struct VP9ParseContext {
|
||||
int n_frames; // 1-8
|
||||
int size[8];
|
||||
int marker_size;
|
||||
int64_t pts;
|
||||
} VP9ParseContext;
|
||||
|
||||
@@ -88,6 +89,21 @@ static int parse(AVCodecParserContext *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (s->n_frames > 0) {
|
||||
int i;
|
||||
int size_sum = 0;
|
||||
|
||||
for (i = 0; i < s->n_frames ;i++)
|
||||
size_sum += s->size[i];
|
||||
size_sum += s->marker_size;
|
||||
|
||||
if (size_sum != size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Inconsistent input frame sizes %d %d\n",
|
||||
size_sum, size);
|
||||
s->n_frames = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->n_frames > 0) {
|
||||
*out_data = data;
|
||||
*out_size = s->size[--s->n_frames];
|
||||
@@ -131,6 +147,7 @@ static int parse(AVCodecParserContext *ctx,
|
||||
data += sz; \
|
||||
size -= sz; \
|
||||
} \
|
||||
s->marker_size = size; \
|
||||
parse_frame(ctx, *out_data, *out_size); \
|
||||
return s->n_frames > 0 ? *out_size : full_size
|
||||
|
||||
|
||||
@@ -1252,6 +1252,11 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
if (remaining_bits(s, gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -remaining_bits(s, gb));
|
||||
s->packet_loss = 1;
|
||||
}
|
||||
|
||||
if (s->packet_done && !s->packet_loss &&
|
||||
remaining_bits(s, gb) > 0) {
|
||||
/* save the rest of the data so that it can be decoded
|
||||
|
||||
@@ -312,6 +312,9 @@ static int output_frame(AVFilterLink *outlink)
|
||||
|
||||
calculate_scales(s, nb_samples);
|
||||
|
||||
if (nb_samples == 0)
|
||||
return 0;
|
||||
|
||||
out_buf = ff_get_audio_buffer(outlink, nb_samples);
|
||||
if (!out_buf)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -109,7 +109,7 @@ static av_cold int init(AVFilterContext *ctx)
|
||||
if (!pan->args) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"pan filter needs a channel layout and a set "
|
||||
"of channels definitions as parameter\n");
|
||||
"of channel definitions as parameter\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (!args)
|
||||
@@ -276,7 +276,7 @@ static int config_props(AVFilterLink *link)
|
||||
if (link->channels > MAX_CHANNELS ||
|
||||
pan->nb_output_channels > MAX_CHANNELS) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"af_pan support a maximum of %d channels. "
|
||||
"af_pan supports a maximum of %d channels. "
|
||||
"Feel free to ask for a higher limit.\n", MAX_CHANNELS);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||
#define OFFSET(x) offsetof(BlackFrameContext, x)
|
||||
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
|
||||
static const AVOption blackframe_options[] = {
|
||||
{ "amount", "Percentage of the pixels that have to be below the threshold "
|
||||
"for the frame to be considered black.", OFFSET(bamount), AV_OPT_TYPE_INT, { .i64 = 98 }, 0, 100, FLAGS },
|
||||
{ "amount", "percentage of the pixels that have to be below the threshold "
|
||||
"for the frame to be considered black", OFFSET(bamount), AV_OPT_TYPE_INT, { .i64 = 98 }, 0, 100, FLAGS },
|
||||
{ "threshold", "threshold below which a pixel value is considered black",
|
||||
OFFSET(bthresh), AV_OPT_TYPE_INT, { .i64 = 32 }, 0, 255, FLAGS },
|
||||
{ "thresh", "threshold below which a pixel value is considered black",
|
||||
|
||||
@@ -190,6 +190,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
|
||||
}
|
||||
|
||||
if (s->occupied) {
|
||||
av_frame_make_writable(s->frame[nout]);
|
||||
for (i = 0; i < s->nb_planes; i++) {
|
||||
// fill in the EARLIER field from the buffered pic
|
||||
av_image_copy_plane(s->frame[nout]->data[i] + s->frame[nout]->linesize[i] * s->first_field,
|
||||
@@ -213,6 +214,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
|
||||
|
||||
while (len >= 2) {
|
||||
// output THIS image as-is
|
||||
av_frame_make_writable(s->frame[nout]);
|
||||
for (i = 0; i < s->nb_planes; i++)
|
||||
av_image_copy_plane(s->frame[nout]->data[i], s->frame[nout]->linesize[i],
|
||||
inpicref->data[i], inpicref->linesize[i],
|
||||
|
||||
@@ -54,7 +54,6 @@ void av_register_all(void)
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = 1;
|
||||
|
||||
avcodec_register_all();
|
||||
|
||||
@@ -418,4 +417,6 @@ void av_register_all(void)
|
||||
REGISTER_PROTOCOL(LIBRTMPTE, librtmpte);
|
||||
REGISTER_PROTOCOL(LIBSSH, libssh);
|
||||
REGISTER_PROTOCOL(LIBSMBCLIENT, libsmbclient);
|
||||
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
@@ -344,14 +344,14 @@ static void avi_metadata_creation_time(AVDictionary **metadata, char *date)
|
||||
|
||||
static void avi_read_nikon(AVFormatContext *s, uint64_t end)
|
||||
{
|
||||
while (avio_tell(s->pb) < end) {
|
||||
while (avio_tell(s->pb) < end && !avio_feof(s->pb)) {
|
||||
uint32_t tag = avio_rl32(s->pb);
|
||||
uint32_t size = avio_rl32(s->pb);
|
||||
switch (tag) {
|
||||
case MKTAG('n', 'c', 't', 'g'): /* Nikon Tags */
|
||||
{
|
||||
uint64_t tag_end = avio_tell(s->pb) + size;
|
||||
while (avio_tell(s->pb) < tag_end) {
|
||||
while (avio_tell(s->pb) < tag_end && !avio_feof(s->pb)) {
|
||||
uint16_t tag = avio_rl16(s->pb);
|
||||
uint16_t size = avio_rl16(s->pb);
|
||||
const char *name = NULL;
|
||||
@@ -608,6 +608,7 @@ static int avi_read_header(AVFormatContext *s)
|
||||
if (s->streams[0]->info)
|
||||
av_freep(&s->streams[0]->info->duration_error);
|
||||
av_freep(&s->streams[0]->info);
|
||||
av_freep(&s->streams[0]->internal);
|
||||
av_freep(&s->streams[0]);
|
||||
s->nb_streams = 0;
|
||||
if (CONFIG_DV_DEMUXER) {
|
||||
@@ -1093,6 +1094,8 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
goto error;
|
||||
|
||||
if (!avformat_open_input(&ast->sub_ctx, "", sub_demuxer, NULL)) {
|
||||
if (ast->sub_ctx->nb_streams != 1)
|
||||
goto error;
|
||||
ff_read_packet(ast->sub_ctx, &ast->sub_pkt);
|
||||
*st->codec = *ast->sub_ctx->streams[0]->codec;
|
||||
ast->sub_ctx->streams[0]->codec->extradata = NULL;
|
||||
@@ -1695,6 +1698,8 @@ static int guess_ni_flag(AVFormatContext *s)
|
||||
size = avio_rl32(s->pb);
|
||||
if (get_stream_idx(tag) == i && pos + size > st->index_entries[1].pos)
|
||||
last_start = INT64_MAX;
|
||||
if (get_stream_idx(tag) == i && size == st->index_entries[0].size + 8)
|
||||
last_start = INT64_MAX;
|
||||
}
|
||||
|
||||
if (st->index_entries[0].pos > last_start)
|
||||
@@ -1843,7 +1848,6 @@ static int avi_read_seek(AVFormatContext *s, int stream_index,
|
||||
continue;
|
||||
|
||||
// av_assert1(st2->codec->block_align);
|
||||
av_assert0(fabs(av_q2d(st2->time_base) - ast2->scale / (double)ast2->rate) < av_q2d(st2->time_base) * 0.00000001);
|
||||
index = av_index_search_timestamp(st2,
|
||||
av_rescale_q(timestamp,
|
||||
st->time_base,
|
||||
|
||||
+7
-1
@@ -33,6 +33,7 @@ static int dcstr_probe(AVProbeData *p)
|
||||
static int dcstr_read_header(AVFormatContext *s)
|
||||
{
|
||||
unsigned codec, align;
|
||||
int mult;
|
||||
AVStream *st;
|
||||
|
||||
st = avformat_new_stream(s, NULL);
|
||||
@@ -46,7 +47,12 @@ static int dcstr_read_header(AVFormatContext *s)
|
||||
align = avio_rl32(s->pb);
|
||||
avio_skip(s->pb, 4);
|
||||
st->duration = avio_rl32(s->pb);
|
||||
st->codec->channels *= avio_rl32(s->pb);
|
||||
mult = avio_rl32(s->pb);
|
||||
if (st->codec->channels <= 0 || mult <= 0 || mult > INT_MAX / st->codec->channels) {
|
||||
av_log(s, AV_LOG_ERROR, "invalid number of channels %d x %d\n", st->codec->channels, mult);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
st->codec->channels *= mult;
|
||||
if (!align || align > INT_MAX / st->codec->channels)
|
||||
return AVERROR_INVALIDDATA;
|
||||
st->codec->block_align = align * st->codec->channels;
|
||||
|
||||
+15
-4
@@ -27,6 +27,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "ffm.h"
|
||||
@@ -361,7 +362,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
}
|
||||
break;
|
||||
case MKBETAG('S', 'T', 'V', 'I'):
|
||||
if (f_stvi++) {
|
||||
if (f_stvi++ || codec->codec_type != AVMEDIA_TYPE_VIDEO) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
@@ -377,6 +378,11 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
@@ -417,7 +423,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
codec->refs = avio_rb32(pb);
|
||||
break;
|
||||
case MKBETAG('S', 'T', 'A', 'U'):
|
||||
if (f_stau++) {
|
||||
if (f_stau++ || codec->codec_type != AVMEDIA_TYPE_AUDIO) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
@@ -443,7 +449,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
}
|
||||
break;
|
||||
case MKBETAG('S', '2', 'V', 'I'):
|
||||
if (f_stvi++ || !size) {
|
||||
if (f_stvi++ || !size || codec->codec_type != AVMEDIA_TYPE_VIDEO) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
@@ -458,7 +464,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
goto fail;
|
||||
break;
|
||||
case MKBETAG('S', '2', 'A', 'U'):
|
||||
if (f_stau++ || !size) {
|
||||
if (f_stau++ || !size || codec->codec_type != AVMEDIA_TYPE_AUDIO) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
@@ -569,6 +575,11 @@ static int ffm_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
@@ -68,10 +69,8 @@ static int read_header(AVFormatContext *s)
|
||||
st->codec->height = avio_rb16(pb);
|
||||
film->leading = avio_rb16(pb);
|
||||
|
||||
if (st->codec->width * 4LL * st->codec->height >= INT_MAX) {
|
||||
av_log(s, AV_LOG_ERROR, "dimensions too large\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
if (av_image_check_size(st->codec->width, st->codec->height, 0, s) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
avpriv_set_pts_info(st, 64, 1, avio_rb16(pb));
|
||||
|
||||
|
||||
@@ -259,8 +259,10 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
|
||||
if (ret < 0){
|
||||
if (ret == AVERROR(EAGAIN))
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
else {
|
||||
av_packet_unref(&pkt);
|
||||
av_assert1(!pkt.size);
|
||||
}
|
||||
}
|
||||
av_init_packet(&out_pkt);
|
||||
av_parser_parse2(parser, st->codec,
|
||||
@@ -277,7 +279,8 @@ static av_unused int64_t flac_read_timestamp(AVFormatContext *s, int stream_inde
|
||||
pts = parser->pts;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (ret < 0)
|
||||
break;
|
||||
}
|
||||
av_parser_close(parser);
|
||||
return pts;
|
||||
|
||||
@@ -1144,7 +1144,7 @@ retry_duration:
|
||||
|
||||
leave:
|
||||
last = avio_rb32(s->pb);
|
||||
if (last != orig_size + 11 &&
|
||||
if (last != orig_size + 11 && last != orig_size + 10 &&
|
||||
(last != orig_size || !last) && last != flv->sum_flv_tag_size &&
|
||||
!flv->broken_sizes) {
|
||||
av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d\n", last, orig_size + 11);
|
||||
|
||||
+10
-6
@@ -62,20 +62,24 @@ void av_register_input_format(AVInputFormat *format)
|
||||
{
|
||||
AVInputFormat **p = last_iformat;
|
||||
|
||||
format->next = NULL;
|
||||
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
|
||||
// Note, format could be added after the first 2 checks but that implies that *p is no longer NULL
|
||||
while(p != &format->next && !format->next && avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
|
||||
p = &(*p)->next;
|
||||
last_iformat = &format->next;
|
||||
|
||||
if (!format->next)
|
||||
last_iformat = &format->next;
|
||||
}
|
||||
|
||||
void av_register_output_format(AVOutputFormat *format)
|
||||
{
|
||||
AVOutputFormat **p = last_oformat;
|
||||
|
||||
format->next = NULL;
|
||||
while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
|
||||
// Note, format could be added after the first 2 checks but that implies that *p is no longer NULL
|
||||
while(p != &format->next && !format->next && avpriv_atomic_ptr_cas((void * volatile *)p, NULL, format))
|
||||
p = &(*p)->next;
|
||||
last_oformat = &format->next;
|
||||
|
||||
if (!format->next)
|
||||
last_oformat = &format->next;
|
||||
}
|
||||
|
||||
int av_match_ext(const char *filename, const char *extensions)
|
||||
|
||||
+60
-49
@@ -62,8 +62,8 @@ typedef struct HTTPContext {
|
||||
int line_count;
|
||||
int http_code;
|
||||
/* Used if "Transfer-Encoding: chunked" otherwise -1. */
|
||||
int64_t chunksize;
|
||||
int64_t off, end_off, filesize;
|
||||
uint64_t chunksize;
|
||||
uint64_t off, end_off, filesize;
|
||||
char *location;
|
||||
HTTPAuthState auth_state;
|
||||
HTTPAuthState proxy_auth_state;
|
||||
@@ -92,9 +92,9 @@ typedef struct HTTPContext {
|
||||
AVDictionary *cookie_dict;
|
||||
int icy;
|
||||
/* how much data was read since the last ICY metadata packet */
|
||||
int icy_data_read;
|
||||
uint64_t icy_data_read;
|
||||
/* after how many bytes of read data a new metadata packet will be found */
|
||||
int icy_metaint;
|
||||
uint64_t icy_metaint;
|
||||
char *icy_metadata_headers;
|
||||
char *icy_metadata_packet;
|
||||
AVDictionary *metadata;
|
||||
@@ -480,7 +480,7 @@ static int http_open(URLContext *h, const char *uri, int flags,
|
||||
else
|
||||
h->is_streamed = 1;
|
||||
|
||||
s->filesize = -1;
|
||||
s->filesize = UINT64_MAX;
|
||||
s->location = av_strdup(uri);
|
||||
if (!s->location)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -607,9 +607,9 @@ static void parse_content_range(URLContext *h, const char *p)
|
||||
|
||||
if (!strncmp(p, "bytes ", 6)) {
|
||||
p += 6;
|
||||
s->off = strtoll(p, NULL, 10);
|
||||
s->off = strtoull(p, NULL, 10);
|
||||
if ((slash = strchr(p, '/')) && strlen(slash) > 0)
|
||||
s->filesize = strtoll(slash + 1, NULL, 10);
|
||||
s->filesize = strtoull(slash + 1, NULL, 10);
|
||||
}
|
||||
if (s->seekable == -1 && (!s->is_akamai || s->filesize != 2147483647))
|
||||
h->is_streamed = 0; /* we _can_ in fact seek */
|
||||
@@ -799,8 +799,9 @@ static int process_line(URLContext *h, char *line, int line_count,
|
||||
if ((ret = parse_location(s, p)) < 0)
|
||||
return ret;
|
||||
*new_location = 1;
|
||||
} else if (!av_strcasecmp(tag, "Content-Length") && s->filesize == -1) {
|
||||
s->filesize = strtoll(p, NULL, 10);
|
||||
} else if (!av_strcasecmp(tag, "Content-Length") &&
|
||||
s->filesize == UINT64_MAX) {
|
||||
s->filesize = strtoull(p, NULL, 10);
|
||||
} else if (!av_strcasecmp(tag, "Content-Range")) {
|
||||
parse_content_range(h, p);
|
||||
} else if (!av_strcasecmp(tag, "Accept-Ranges") &&
|
||||
@@ -809,7 +810,7 @@ static int process_line(URLContext *h, char *line, int line_count,
|
||||
h->is_streamed = 0;
|
||||
} else if (!av_strcasecmp(tag, "Transfer-Encoding") &&
|
||||
!av_strncasecmp(p, "chunked", 7)) {
|
||||
s->filesize = -1;
|
||||
s->filesize = UINT64_MAX;
|
||||
s->chunksize = 0;
|
||||
} else if (!av_strcasecmp(tag, "WWW-Authenticate")) {
|
||||
ff_http_auth_handle_header(&s->auth_state, tag, p);
|
||||
@@ -833,7 +834,7 @@ static int process_line(URLContext *h, char *line, int line_count,
|
||||
if (parse_cookie(s, p, &s->cookie_dict))
|
||||
av_log(h, AV_LOG_WARNING, "Unable to parse '%s'\n", p);
|
||||
} else if (!av_strcasecmp(tag, "Icy-MetaInt")) {
|
||||
s->icy_metaint = strtoll(p, NULL, 10);
|
||||
s->icy_metaint = strtoull(p, NULL, 10);
|
||||
} else if (!av_strncasecmp(tag, "Icy-", 4)) {
|
||||
if ((ret = parse_icy(s, tag, p)) < 0)
|
||||
return ret;
|
||||
@@ -963,7 +964,7 @@ static int http_read_header(URLContext *h, int *new_location)
|
||||
char line[MAX_URL_SIZE];
|
||||
int err = 0;
|
||||
|
||||
s->chunksize = -1;
|
||||
s->chunksize = UINT64_MAX;
|
||||
|
||||
for (;;) {
|
||||
if ((err = http_get_line(s, line, sizeof(line))) < 0)
|
||||
@@ -997,7 +998,7 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
|
||||
int post, err;
|
||||
char headers[HTTP_HEADERS_SIZE] = "";
|
||||
char *authstr = NULL, *proxyauthstr = NULL;
|
||||
int64_t off = s->off;
|
||||
uint64_t off = s->off;
|
||||
int len = 0;
|
||||
const char *method;
|
||||
int send_expect_100 = 0;
|
||||
@@ -1045,7 +1046,7 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
|
||||
// server supports seeking by analysing the reply headers.
|
||||
if (!has_header(s->headers, "\r\nRange: ") && !post && (s->off > 0 || s->end_off || s->seekable == -1)) {
|
||||
len += av_strlcatf(headers + len, sizeof(headers) - len,
|
||||
"Range: bytes=%"PRId64"-", s->off);
|
||||
"Range: bytes=%"PRIu64"-", s->off);
|
||||
if (s->end_off)
|
||||
len += av_strlcatf(headers + len, sizeof(headers) - len,
|
||||
"%"PRId64, s->end_off - 1);
|
||||
@@ -1120,7 +1121,7 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
|
||||
s->line_count = 0;
|
||||
s->off = 0;
|
||||
s->icy_data_read = 0;
|
||||
s->filesize = -1;
|
||||
s->filesize = UINT64_MAX;
|
||||
s->willclose = 0;
|
||||
s->end_chunked_post = 0;
|
||||
s->end_header = 0;
|
||||
@@ -1152,6 +1153,34 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
||||
{
|
||||
HTTPContext *s = h->priv_data;
|
||||
int len;
|
||||
|
||||
if (s->chunksize != UINT64_MAX) {
|
||||
if (!s->chunksize) {
|
||||
char line[32];
|
||||
int err;
|
||||
|
||||
do {
|
||||
if ((err = http_get_line(s, line, sizeof(line))) < 0)
|
||||
return err;
|
||||
} while (!*line); /* skip CR LF from last chunk */
|
||||
|
||||
s->chunksize = strtoull(line, NULL, 16);
|
||||
|
||||
av_log(h, AV_LOG_TRACE,
|
||||
"Chunked encoding data size: %"PRIu64"'\n",
|
||||
s->chunksize);
|
||||
|
||||
if (!s->chunksize)
|
||||
return 0;
|
||||
else if (s->chunksize == UINT64_MAX) {
|
||||
av_log(h, AV_LOG_ERROR, "Invalid chunk size %"PRIu64"\n",
|
||||
s->chunksize);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
size = FFMIN(size, s->chunksize);
|
||||
}
|
||||
|
||||
/* read bytes from input buffer first */
|
||||
len = s->buf_end - s->buf_ptr;
|
||||
if (len > 0) {
|
||||
@@ -1160,15 +1189,13 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
||||
memcpy(buf, s->buf_ptr, len);
|
||||
s->buf_ptr += len;
|
||||
} else {
|
||||
int64_t target_end = s->end_off ? s->end_off : s->filesize;
|
||||
if ((!s->willclose || s->chunksize < 0) &&
|
||||
target_end >= 0 && s->off >= target_end)
|
||||
uint64_t target_end = s->end_off ? s->end_off : s->filesize;
|
||||
if ((!s->willclose || s->chunksize == UINT64_MAX) && s->off >= target_end)
|
||||
return AVERROR_EOF;
|
||||
len = ffurl_read(s->hd, buf, size);
|
||||
if (!len && (!s->willclose || s->chunksize < 0) &&
|
||||
target_end >= 0 && s->off < target_end) {
|
||||
if (!len && (!s->willclose || s->chunksize == UINT64_MAX) && s->off < target_end) {
|
||||
av_log(h, AV_LOG_ERROR,
|
||||
"Stream ends prematurely at %"PRId64", should be %"PRId64"\n",
|
||||
"Stream ends prematurely at %"PRIu64", should be %"PRIu64"\n",
|
||||
s->off, target_end
|
||||
);
|
||||
return AVERROR(EIO);
|
||||
@@ -1176,8 +1203,10 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
||||
}
|
||||
if (len > 0) {
|
||||
s->off += len;
|
||||
if (s->chunksize > 0)
|
||||
if (s->chunksize > 0) {
|
||||
av_assert0(s->chunksize >= len);
|
||||
s->chunksize -= len;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
@@ -1231,25 +1260,6 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (s->chunksize >= 0) {
|
||||
if (!s->chunksize) {
|
||||
char line[32];
|
||||
|
||||
do {
|
||||
if ((err = http_get_line(s, line, sizeof(line))) < 0)
|
||||
return err;
|
||||
} while (!*line); /* skip CR LF from last chunk */
|
||||
|
||||
s->chunksize = strtoll(line, NULL, 16);
|
||||
|
||||
av_log(NULL, AV_LOG_TRACE, "Chunked encoding data size: %"PRId64"'\n",
|
||||
s->chunksize);
|
||||
|
||||
if (!s->chunksize)
|
||||
return 0;
|
||||
}
|
||||
size = FFMIN(size, s->chunksize);
|
||||
}
|
||||
#if CONFIG_ZLIB
|
||||
if (s->compressed)
|
||||
return http_buf_read_compressed(h, buf, size);
|
||||
@@ -1257,17 +1267,17 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
|
||||
read_ret = http_buf_read(h, buf, size);
|
||||
if ( (read_ret < 0 && s->reconnect && (!h->is_streamed || s->reconnect_streamed) && s->filesize > 0 && s->off < s->filesize)
|
||||
|| (read_ret == 0 && s->reconnect_at_eof && (!h->is_streamed || s->reconnect_streamed))) {
|
||||
int64_t target = h->is_streamed ? 0 : s->off;
|
||||
uint64_t target = h->is_streamed ? 0 : s->off;
|
||||
|
||||
if (s->reconnect_delay > s->reconnect_delay_max)
|
||||
return AVERROR(EIO);
|
||||
|
||||
av_log(h, AV_LOG_INFO, "Will reconnect at %"PRId64" error=%s.\n", s->off, av_err2str(read_ret));
|
||||
av_log(h, AV_LOG_INFO, "Will reconnect at %"PRIu64" error=%s.\n", s->off, av_err2str(read_ret));
|
||||
av_usleep(1000U*1000*s->reconnect_delay);
|
||||
s->reconnect_delay = 1 + 2*s->reconnect_delay;
|
||||
seek_ret = http_seek_internal(h, target, SEEK_SET, 1);
|
||||
if (seek_ret != target) {
|
||||
av_log(h, AV_LOG_ERROR, "Failed to reconnect at %"PRId64".\n", target);
|
||||
av_log(h, AV_LOG_ERROR, "Failed to reconnect at %"PRIu64".\n", target);
|
||||
return read_ret;
|
||||
}
|
||||
|
||||
@@ -1322,10 +1332,11 @@ static int store_icy(URLContext *h, int size)
|
||||
{
|
||||
HTTPContext *s = h->priv_data;
|
||||
/* until next metadata packet */
|
||||
int remaining = s->icy_metaint - s->icy_data_read;
|
||||
uint64_t remaining;
|
||||
|
||||
if (remaining < 0)
|
||||
if (s->icy_metaint < s->icy_data_read)
|
||||
return AVERROR_INVALIDDATA;
|
||||
remaining = s->icy_metaint - s->icy_data_read;
|
||||
|
||||
if (!remaining) {
|
||||
/* The metadata packet is variable sized. It has a 1 byte header
|
||||
@@ -1439,7 +1450,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
|
||||
{
|
||||
HTTPContext *s = h->priv_data;
|
||||
URLContext *old_hd = s->hd;
|
||||
int64_t old_off = s->off;
|
||||
uint64_t old_off = s->off;
|
||||
uint8_t old_buf[BUFFER_SIZE];
|
||||
int old_buf_size, ret;
|
||||
AVDictionary *options = NULL;
|
||||
@@ -1450,7 +1461,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
|
||||
((whence == SEEK_CUR && off == 0) ||
|
||||
(whence == SEEK_SET && off == s->off)))
|
||||
return s->off;
|
||||
else if ((s->filesize == -1 && whence == SEEK_END))
|
||||
else if ((s->filesize == UINT64_MAX && whence == SEEK_END))
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
if (whence == SEEK_CUR)
|
||||
@@ -1605,7 +1616,7 @@ redo:
|
||||
s->buf_ptr = s->buffer;
|
||||
s->buf_end = s->buffer;
|
||||
s->line_count = 0;
|
||||
s->filesize = -1;
|
||||
s->filesize = UINT64_MAX;
|
||||
cur_auth_type = s->proxy_auth_state.auth_type;
|
||||
|
||||
/* Note: This uses buffering, potentially reading more than the
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user