Commit Graph

68528 Commits

Author SHA1 Message Date
Michael Niedermayer
1bf416dfc3 avcodec/hevc: Fix typo in num_entry_point_offsets check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3051e7fa71)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
d3c9d87eea avcodec/libtheoraenc: Check for av_malloc failure
Fixes CID1257799

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c64b2d480b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
228f7c7eed avcodec/dcadec: Check active_bands
Fixes CID1297594 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc624ec9ba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
ba82b23a1d avcodec/dcadec: Check scale table index
Fixes CID1297594 part 1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f3e6959bf)

Conflicts:

	libavcodec/dcadec.c
2015-05-21 20:43:39 +02:00
Michael Niedermayer
665b343f92 avcodec/sonic: More completely check sample_rate_index and channels
Fixes CID1271783

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ade8a46154)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
43f9ec7113 avcodec/sonic: check memory allocations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c131a9fead)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
8d02ba5b7b avcodec/smvjpegdec: check avcodec_decode_video2() return code
Fixes CID1271810

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cdd25f9a3d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
cb0cc44f3a avcodec/shorten: More complete pred_order check
Fixes CID1239055

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 294469416d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
71689e7863 avcodec/shorten: Check skip_bytes()
Fixes CID1210526

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d201becfc0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
d2fbf8b569 avcodec/shorten: Fix code depending on signed overflow behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d15588124)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
c14359f24d avcodec/proresdec2: Reset slice_count on deallocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4c6aea397)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
9fb1c02f30 ffmpeg_opt: Fix -timestamp parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 107e4da476)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
4a49f1e764 avcodec/dcadec: Check subsubframes
Fixes: CID1239152

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a9bf628bfd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
474bfd5438 avcodec/dcadec: Check nchans
Fixes CID1239110

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a6a45774d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
wm4
02c1074f18 hevc: make avcodec_decode_video2() fail if get_format() fails
Personally, I need the decoder to back out if get_format() returns no
usable pixel format. This didn't work because the error code was not
propagated down the call chain. This in turn happened because the
variable declaration removed in this patch shadowed the variable, whose
value is returned at the end of the function. Consequently, failures of
decode_nal_unit() were ignored in this place.

Reviewed-by:  Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc5e4bb484)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
db00ecbc96 avcodec/cavsdec: Use ff_set_dimensions()
Fixes CID1239111 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6b8b96607)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
ebdbb13108 avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 139e1c8009)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
cdc4727766 avcodec/on2avc: Check run more carefully
Fixes CID1239106

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 22f15f5735)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4858ee1d9c avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
This avoids potential accesses over the end

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93cfa7d169)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Rainer Hochecker
63d484c342 swr: fix alignment issue caused by 8ch sse functions
Fix crash when doing 8 ch conversion from apps compiled with MSVS
Thanks to Ronald for giving this hint:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-May/173049.html

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adb7372f74)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4c6224b1cd avcodec/mjpegdec: fix len computation in ff_mjpeg_decode_dqt()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81cf910856)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
bf2254bffd avcodec/jpeg2000dec: fix boolean operator
Fixes CID1271791 #7-6

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f8f155a18a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
2cab5f4ad0 avcodec/hevc_ps: Explicitly check num_tile_* for negative values
This fixes nothing but maybe helps coverity which does not see that this is failing later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 65e5032955)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
1ed8a10487 avcodec/hevc_ps: Check vps_num_hrd_parameters
Fix CID1239052 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b195aa5d52)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
502684348b avcodec/hevc_ps: More completely check vps_num_layer_sets
Fixes CID1239052  part1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 16c95b1073)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
58f310f496 avcodec/hevc: Check num_entry_point_offsets
Fixes CID1239099 part 2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c6ae98d4a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
0230a8efc6 avcodec/hevc: Check offset_len
Fixes CID1239099 part 1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e9d5e16ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Nick Lewycky
ef5fa5099b libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48e9f68384)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
885f501f7a avcodec/hevc_sei: Check num_sps_ids_minus1 value
Fixes CID1271794

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93b0ee21a2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
00223d461b avcodec/vqavideo: Check chunk size
Fixes CID1239154

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8a62b80ce6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Andreas Cadhalpun
7d45230d81 aacdec: don't return frames without data
Since commit 676a395a aac->frame->data is not necessarily allocated at
the end of aac_decode_frame_int if avctx->channels is 0.

In this case a bogus frame without any data, but non-zero nb_samples is
returned.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ec38a1ba40)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
254e3af60f avformat/hevc: Check num_negative_pics and num_positive_pics
Fixes CID1238994

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b62b3292d8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
05c2801413 avformat/hevc: Check cpb_cnt_minus1
Fixes CID1239014

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2cddc0b19a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b7a3a3a8d2 avformat/matroskadec: Cleanup error handling for bz2 & zlib
Fixes CID703652

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 171af59d58)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
2012a226d2 avformat/nutdec: Fix use of uinitialized value
Fixes CID1041175

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 56abf35151)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b8e0b6c702 avformat/rtpenc_jpeg: Check remaining buffer size for SOS
Fixes CID1238818

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81198a6837)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
1973b6ac5c avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()
Larger packets are not supported and would cause problems later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aa5169935e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
9c10c0fdcd tools/graph2dot: use larger data types than int for array/string sizes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit acf4925f44)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Andreas Cadhalpun
596b9d6ed8 id3v2: catch avio_read errors in check_tag
Since len is an unsigned int, the comparison is currently treated as
unsigned and thus ignores all errors from avio_read.

Thus cast len to int, which is unproblematic, because at that point len
is between 0 and 4.

This fixes 'Conditional jump or move depends on uninitialised value'
valgrind warnings in is_tag.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0382c94f13)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
699357dd4e avformat/matroskaenc: Check ff_vorbiscomment_length in put_flac_codecpriv()
Its currently guaranteed to be smaller but its safer to check anyway

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66f26b3e8e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
ff0f0b1e83 avformat/oggenc: Check ff_vorbiscomment_length in ogg_write_vorbiscomment()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0db5b2b9f8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
cb1ecf08b2 avformat/flacenc: Check length in flac_write_block_comment()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 40a7700b82)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
e3d9bf1151 avformat/subtitles: Use size_t for len
string length could theoretically be larger than int

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a633928d47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b2d31dcf04 avformat/url: Use size_t for len from strlen()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 95efc65129)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
a9f003b8ac avutil/avstring: Use size_t in av_strlcatf()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae4eea8be4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4d3450d62f avformat/vorbiscomment: Check entry length in ff_vorbiscomment_write()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eca38864a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
466575c0e0 avutil/dict: Use size_t for appending strings
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c128ea162)

Conflicts:

	libavutil/dict.c
2015-05-21 20:43:38 +02:00
Michael Niedermayer
dc8f42e037 libavutil/mem: use size_t for the length in av_strdup()
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4950bd4ebe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
bb523c1b86 aacsbr: break infinite loop in sbr_hf_calc_npatches
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 584cc1ade1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
b8568c546e diracdec: check that block length is valid
In init_planes p->xblen and p->yblen are set to:
            p->xblen = s->plane[0].xblen >> s->chroma_x_shift;
            p->yblen = s->plane[0].yblen >> s->chroma_y_shift;

These are later used as block_w and block_h arguments of
s->vdsp.emulated_edge_mc. If one of them is 0 it triggers an av_assert2
in emulated_edge_mc:
    av_assert2(start_x < end_x && block_w > 0);
    av_assert2(start_y < end_y && block_h > 0);

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 75fc81c831)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00