Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f46d5199ee1_9456_vc1-wmapro.ism
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This was never done for avi files, the decoder always produced
output no matter if a palette was computed or not.
Since a non-standard palette was needed, this simplifies the code.
See issue 1067 and ticket #165.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes use of uninitialized data
Fixes: msan_uninit-mem_7ff57193e77e_2715_RAW512K_Stream_004.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes out of array read
Fixes: signal_sigsegv_6f1855_3910_avid_test_alpha.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Generate extradata with SPS/PPS based on container dimensions.
Authors of this commit are: Reimar and Thomas Mundt
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Fixes playback of some AAC streams, which are otherwise mangled by the
parser, and stss is typically only valid for video anyway.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b698542ad83284fbb8c22404e3cafeb2dd739d38':
mov: Don't allocate arrays with av_malloc that will be realloced
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c231987662194d009dd91bfc57c678e0e70ca161':
mov: Make sure the read sample count is nonnegative
Conflicts:
libavformat/mov.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This avoids setting a negative number of frames, ending up with a
negative average frame rate.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.
Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '7f8d41eb097e8d4223c9caf97dd332a2fdb29d52':
mov: Don't use a negative duration for setting other fields
Conflicts:
libavformat/mov.c
See: 87d073eacc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Some files have the duration set to -1 in the mdhd atom, more
or less legitimately. (We produce such files ourselves, for the
initial duration in fragmented mp4 files.)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '08504380ddf25d6905e189e9bf52e7a4c771a415':
mov: Refactor codec specific final steps in mov_finalize_stsd_codec
Conflicts:
libavformat/mov.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'dc518a3ae21e7b6420131b813cfc6bcdcad26b7e':
mov: Refactor subtitle specific parsing in mov_parse_stsd_subtitle
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'a3b53ff062eaccdaa28964899c63520ef2978c2e':
mov: Refactor video specific parsing in mov_parse_stsd_video
Conflicts:
libavformat/mov.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '1f70a5ad284b33e8b3e2b40a5cb33055419781b7':
mov: use tkhd enabled flag to set the default track
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '31931520df35a6f9606fe8293c8a39e2d1fabedf':
mov: Do not allow updating the time scale after it has been set
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '5b4eb243bce10a3e8345401a353749e0414c54ca':
mov: Seek back if overreading an individual atom
Conflicts:
libavformat/mov.c
See: 6093960ae3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The time scale is set in mdhd, and later validated in the
enclosing trak atom once all of its children have been parsed.
A loose mdhd atom outside of a trak atom could update the time
scale of the last stream without any validation.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>