Michael Niedermayer
56abf35151
avformat/nutdec: Fix use of uinitialized value
...
Fixes CID1041175
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
254f3daba4
nut: Make sure to clean up on read_header failure
...
Based on Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> work.
CC: libav-stable@libav.org
10 years ago
Andreas Cadhalpun
b34257eefd
nut: Check chapter creation in decode_info_header
...
This fixes a segmentation fault when accessing the metadata.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
CC: libav-stable@libav.org
10 years ago
Andreas Cadhalpun
7c24ca1bda
nutdec: fix illegal count check in decode_main_header
...
The existing check has two problems:
1) i + count can overflow, so that the check '< 256' returns true.
2) In the (i == 'N') case occurs a j-- so that the loop runs once more.
This can trigger the assertion 'nut->header_len[0] == 0' or cause
segmentation faults or infinite hangs.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
361702660d
nutdec: fix memleaks on error in nut_read_header
...
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
3ff1af2b0d
nutdec: check chapter creation in decode_info_header
...
This fixes a segmentation fault when accessing the metadata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andreas Cadhalpun
6621105877
nutdec: check for negative frame rate in decode_info_header
...
A negative frame rate triggers an av_assert2 in av_rescale_rnd.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4a10811617
avformat/nutdec: Use av_malloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
5a2645cafe
nutdec: Prevent leaks on memory error
...
Bug-Id: CID 205122 / CID 205123
10 years ago
Hugo Beauzée-Luyssen
3035d21b5a
nutdec: Check memory allocations
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
wm4
9deaec7828
lavf: move internal fields from public to internal context
...
This is not an API change; the fields were explicitly declared private
before.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Anton Khirnov
05e59135b3
nutdec: do not set has_b_frames
...
It is not supposed to be set by demuxers.
10 years ago
Vittorio Giovara
af7ca6ea12
nutdec: check av_new_packet return value
...
CC: libav-stable@libav.org
Bug-Id: CID 733713
10 years ago
Luca Barbato
96bfb67747
nutdec: Prevent a memory corruption
...
Chapters do not have an event_flags field.
Bug-Id: CID 1231990
10 years ago
Michael Niedermayer
05dd5368a9
avformat/nutdec: always initialize event_flags
...
Fixes: CID1231990
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andrew Stone
fa3a5dd4de
nutdec: update AVFormatContext.event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
James Almer
d34ec64a22
replace calls to url_feof() with avio_feof()
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
52a1c32c0a
nut: Use nut->version in the version range check
...
It was wrongly left unchanged when the version field had been
introduced. (c94e2e85cb
)
11 years ago
Michael Niedermayer
a981d1b6aa
avformat/nutdec: if all else fails try to lookup video tag in isom
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
74bd039f8c
avformat/nutdec: improve probe speed by 30%
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6b041cb617
avformat/nutdec: Fix handling of older 4.0 files
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
c94e2e85cb
nut: Support experimental NUT 4 features
...
Add the low overhead pipe mode and the extended broadcast mode.
Export the options as 'syncponts' since it impacts only that.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Michael Niedermayer
968516cebf
avformat/nut: add ff_nut_audio_extra_tags to demuxer too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7f9697aa11
avformat/nutdec: fix packet end clearing
...
The code was buggy, using the wrong variable, also it missed the case
where the packet become smaller due to sidedata/metadata being extracted
which left a few bytes uninitialized
Fixes use of uninitialized memory
Fixed: msan_uninit-mem_7f6abbe44530_6838_mewmew_vorbis_ssa.nut
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
71fe97a60a
avformat/nutdec: check avio_read() return code
...
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f2785ab8669_6838_mewmew_vorbis_ssa.nut
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d04aceb7d0
avformat/nutdec: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8113e838a8
avformat/nut: add support for per frame side & meta data with version 4
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
0cedc6c066
avformat/nutdec: use ff_get_extradata()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
804ea14b35
avformat/nut: add minor_version field with version>=4
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6aa50374bf
avformat/nut: store version in the context
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Derek Buitenhuis
b1fcdc08ce
nut: Fix unchecked allocations
...
CC: libav-stable@libav.org
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Derek Buitenhuis
55ae13e3de
nut: Fix unchecked allocations
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Paul B Mahol
a807c68253
avformat: use ff_alloc_extradata()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
269845db86
avformat/nutdec: check for allocation failures
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Michael Niedermayer
7f25050289
nutdec: use ff_find_last_ts()
...
Fixes finding the duration for nut files that are truncated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
e0c53c3408
nut: use meaningful error values
...
Fix the mispresented EINVAL for EOF on partial files, among the other.
12 years ago
Luca Barbato
46c1917350
nut: use a define for the nut version
...
Ease switching version in the future and make evident why that value.
12 years ago
Michael Niedermayer
fd68371b07
nutdec: Implement duration parsing for indexed nuts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
9bb54bb685
nutdec: more specific return codes for decode_syncpoint()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
7ccc0ed6a0
nutdec: print error on invalid/unsupported fourcc style
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
d8c772de53
nutdec: Always return a value from nut_read_timestamp()
...
The function is a callback that is called by ff_gen_search with
a constant stream index.
Avoid a false positive on older gcc version.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
ebfb738fa4
nutdec: sanity check r_frame_rate
...
This fixes files that store a somewhat incorrect value.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
bfe5454cd2
lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h
12 years ago
Luca Barbato
d4bff9f1ab
nut: support textual data
...
Plain text (utf8 encoded) data can be muxed and demuxed in nut.
12 years ago
Michael Niedermayer
73581afe01
nutdec: fix integer overflow
...
Fixes CID700575
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
bb502411dd
nutdec: check return value of av_new_packet()
...
Fixes CID733173.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Luca Barbato
1bd442c276
nut: prioritize native tags
...
Use native tags instead of avi ones, simplifies a lot raw video codecs
handling.
12 years ago
Luca Barbato
92281850a2
nut: support pcm codecs not mapped in avi
...
The native tags will be used when available.
12 years ago
Luca Barbato
72d30b2792
nut: add do {} while (0) to GET_V
...
Make it consistent with the other function-like macros.
12 years ago
Michael Niedermayer
e3fb5bc147
nut: store and read the r_frame_rate
...
With this, when we use a finer timebase than neccessary to store
durations the demuxer still knows what the original timebase was.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago