ffmpeg.git
7 years agoUpdate version numbers for 0.7.5 n0.7.5
Michael Niedermayer [Thu, 22 Sep 2011 00:30:14 +0000 (02:30 +0200)]
Update version numbers for 0.7.5

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
7 years agoMerge branch 'release/0.8' into release/0.7
Michael Niedermayer [Wed, 21 Sep 2011 23:41:55 +0000 (01:41 +0200)]
Merge branch 'release/0.8' into release/0.7

* release/0.8: (154 commits)
  vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling
  Check for huffman tree building error in vp6 decoder.
  Release old pictures after a resolution change in vp5/6 decoder
  Check for missing reference in vp5/6 decoder.
  Check for invalid slices offsets in RV30/40 decoder.
  Check output buffer size in nellymoser decoder.
  Hack around gcc 4.6 breaking asm using call.
  Fix dxva2 decoding for some H264 samples.
  mp3demux: pass on error code on packet read.
  Check for invalid slice offsets in real decoder.
  rmdec: Reject invalid deinterleaving parameters
  Use deinterleavers for demangling audio packets in RealMedia.
  rv10: Reject slices that does not have the same type as the first one
  rmdec: use the deinterleaving mode and not the codec when creating audio packets.
  MAINTAINERS: add my GPG fingerprint. (cherry picked from commit 7882dc10f871bf25a848fe62a152f63814f9c7d1)
  Support 3IVD in isom, produced by 3ivx DivX Doctor.
  mpegpsdec: fix reading first mpegps packet (cherry picked from commit b2f230e23dd61112ac090b0c059d87b5f6bcb307)
  Avoid NULL dereference on corrupted bitstream with real decoder.
  Reject slices that does not have the same type than the first one in RV10/RV20 decoder.
  check all svq3_get_ue_golomb() returns.
  ...

Conflicts:
Doxyfile
RELEASE
VERSION
libavcodec/rv34.c
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
7 years agovp6: partially propagate huffman tree building errors during coeff model parsing...
Dustin Brody [Tue, 16 Aug 2011 20:46:34 +0000 (16:46 -0400)]
vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit f913eeea43078b3b9052efd8d8d29e7b29b39208)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
7 years agoCheck for huffman tree building error in vp6 decoder.
Laurent Aimar [Wed, 21 Sep 2011 18:46:32 +0000 (20:46 +0200)]
Check for huffman tree building error in vp6 decoder.

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

7 years agoRelease old pictures after a resolution change in vp5/6 decoder
Laurent Aimar [Wed, 21 Sep 2011 18:46:33 +0000 (20:46 +0200)]
Release old pictures after a resolution change in vp5/6 decoder

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

7 years agoCheck for missing reference in vp5/6 decoder.
Laurent Aimar [Wed, 21 Sep 2011 18:46:30 +0000 (20:46 +0200)]
Check for missing reference in vp5/6 decoder.

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

7 years agoCheck for invalid slices offsets in RV30/40 decoder.
Laurent Aimar [Wed, 21 Sep 2011 18:46:31 +0000 (20:46 +0200)]
Check for invalid slices offsets in RV30/40 decoder.

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

7 years agoCheck output buffer size in nellymoser decoder.
Laurent Aimar [Wed, 21 Sep 2011 18:46:29 +0000 (20:46 +0200)]
Check output buffer size in nellymoser decoder.

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

7 years agoMerge remote-tracking branch 'khirnov/release/0.7' into release/0.8
Michael Niedermayer [Wed, 21 Sep 2011 23:10:24 +0000 (01:10 +0200)]
Merge remote-tracking branch 'khirnov/release/0.7' into release/0.8

* khirnov/release/0.7: (64 commits)
  rv34: Check for invalid slice offsets
  rv34: Fix potential overreads
  rv34: Avoid NULL dereference on corrupted bitstream
  rv10: Reject slices that does not have the same type as the first one
  lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
  oggdec: fix out of bound write in the ogg demuxer
  Fixed size given to init_get_bits().
  smacker: fix a few off by 1 errors
  Check for invalid VLC value in smacker decoder.
  Check and propagate errors when VLC trees cannot be built in smacker decoder.
  Fixed off by one packet size allocation in the smacker demuxer.
  Check for invalid packet size in the smacker demuxer.
  ape demuxer: fix segfault on memory allocation failure.
  xan: Add some buffer checks (cherry picked from commit 0872bb23b4bd2d94a8ba91070f706d1bc1c3ced8)
  Fixed size given to init_get_bits() in xan decoder. (cherry picked from commit 393d5031c6aaaf8c2dda4eb5d676974c349fae85)
  smacker demuxer: handle possible av_realloc() failure.
  Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
  cljr: init_get_bits size in bits instead of bytes (cherry picked from commit 0c1f5b93d9b97c4cc3684ba91a040e90bfc760d2)
  indeo2: fail if input buffer too small (cherry picked from commit b7ce4f1d1c3add86ece7ca595ea6c4a10b471055)
  indeo2: init_get_bits size in bits instead of bytes (cherry picked from commit 68ca330cbd479111db9cb7649d7530ad59f04cc8)
  ...

Conflicts:
ffmpeg.c
libavdevice/alsa-audio.h
libavformat/gxf.c
libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
7 years agoHack around gcc 4.6 breaking asm using call.
Reimar Döffinger [Sun, 28 Aug 2011 19:14:13 +0000 (21:14 +0200)]
Hack around gcc 4.6 breaking asm using call.

gcc 4.6 no longer decrements esp to account for local variables.
Thus using call will end up overwriting some local variable.
So add an extra one it can safely clobber.
This is a huge hack because it's basically pure chance it works,
no idea how this is supposed to be done.

Fixes trac ticket #397.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit c928e9172928f3cddab949b107dd53b6bf79555e)

7 years agoHack around gcc 4.6 breaking asm using call.
Reimar Döffinger [Sun, 28 Aug 2011 19:14:13 +0000 (21:14 +0200)]
Hack around gcc 4.6 breaking asm using call.

gcc 4.6 no longer decrements esp to account for local variables.
Thus using call will end up overwriting some local variable.
So add an extra one it can safely clobber.
This is a huge hack because it's basically pure chance it works,
no idea how this is supposed to be done.

Fixes trac ticket #397.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit c928e9172928f3cddab949b107dd53b6bf79555e)

7 years agoFix dxva2 decoding for some H264 samples.
Carl Eugen Hoyos [Wed, 21 Sep 2011 21:47:34 +0000 (23:47 +0200)]
Fix dxva2 decoding for some H264 samples.
(cherry picked from commit bf7dc6b29d785f149f18c39db021413e08735546)

7 years agoFix dxva2 decoding for some H264 samples.
Carl Eugen Hoyos [Wed, 21 Sep 2011 21:47:34 +0000 (23:47 +0200)]
Fix dxva2 decoding for some H264 samples.

7 years agomp3demux: pass on error code on packet read.
Michael Niedermayer [Tue, 20 Sep 2011 22:51:53 +0000 (00:51 +0200)]
mp3demux: pass on error code on packet read.

Reported-by: Tanami, Ohad
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c83442b0571370b946d3f8bb85c46879d62ab10a)

7 years agoCheck for invalid slice offsets in real decoder.
Laurent Aimar [Mon, 19 Sep 2011 20:48:53 +0000 (22:48 +0200)]
Check for invalid slice offsets in real decoder.

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

7 years agormdec: Reject invalid deinterleaving parameters
Laurent Aimar [Fri, 16 Sep 2011 22:05:13 +0000 (00:05 +0200)]
rmdec: Reject invalid deinterleaving parameters

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoUse deinterleavers for demangling audio packets in RealMedia.
Kostya Shishkov [Sat, 13 Aug 2011 19:02:54 +0000 (21:02 +0200)]
Use deinterleavers for demangling audio packets in RealMedia.

Unlike other containers RealMedia stores its audio packets in scrambled form,
with interleaver ID preceeding audio codec ID. Currently deinterleaving
decision is tied to the codec while it's possible to have non-default
deinterleaver with audio codec (like Int0 deinterleaver instead of specific
one for Sipro).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agorv10: Reject slices that does not have the same type as the first one
Laurent Aimar [Sat, 17 Sep 2011 22:03:08 +0000 (00:03 +0200)]
rv10: Reject slices that does not have the same type as the first one

This prevents crashes with some corrupted bitstreams.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agormdec: use the deinterleaving mode and not the codec when creating audio packets.
Laurent Aimar [Sat, 17 Sep 2011 21:17:45 +0000 (21:17 +0000)]
rmdec: use the deinterleaving mode and not the codec when creating audio packets.

It prevents crashes due to non initialized fields.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 3e033da84782e12ed529e6a88dd53b6a72199e8e)

7 years agoMAINTAINERS: add my GPG fingerprint.
Gwenole Beauchesne [Mon, 19 Sep 2011 14:57:10 +0000 (16:57 +0200)]
MAINTAINERS: add my GPG fingerprint.
(cherry picked from commit 7882dc10f871bf25a848fe62a152f63814f9c7d1)

7 years agoSupport 3IVD in isom, produced by 3ivx DivX Doctor.
Carl Eugen Hoyos [Mon, 19 Sep 2011 10:20:42 +0000 (12:20 +0200)]
Support 3IVD in isom, produced by 3ivx DivX Doctor.

Fixes ticket #486.
(cherry picked from commit 4a9b069b6742f78ed7511d2a87af621ab1d43a59)

7 years agompegpsdec: fix reading first mpegps packet
Arne de Bruijn [Sat, 17 Sep 2011 12:59:00 +0000 (14:59 +0200)]
mpegpsdec: fix reading first mpegps packet
(cherry picked from commit b2f230e23dd61112ac090b0c059d87b5f6bcb307)

7 years agoAvoid NULL dereference on corrupted bitstream with real decoder.
Laurent Aimar [Sat, 17 Sep 2011 21:43:58 +0000 (23:43 +0200)]
Avoid NULL dereference on corrupted bitstream with real decoder.

rv34_decode_slice() can return without allocating any pictures.

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

7 years agoReject slices that does not have the same type than the first one in RV10/RV20 decoder.
Laurent Aimar [Sat, 17 Sep 2011 22:17:44 +0000 (00:17 +0200)]
Reject slices that does not have the same type than the first one in RV10/RV20 decoder.

This prevents crashes with some corrupted bitstreams.

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

7 years agocheck all svq3_get_ue_golomb() returns.
Michael Niedermayer [Sat, 17 Sep 2011 19:53:21 +0000 (21:53 +0200)]
check all svq3_get_ue_golomb() returns.

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

7 years agorv34: check for size mismatch
Michael Niedermayer [Sat, 17 Sep 2011 17:40:25 +0000 (19:40 +0200)]
rv34: check for size mismatch

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

7 years agoReject audio tracks with invalid interleaver parameters in RM demuxer.
Laurent Aimar [Sat, 17 Sep 2011 14:56:33 +0000 (16:56 +0200)]
Reject audio tracks with invalid interleaver parameters in RM demuxer.

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

7 years agoFix js_vlc_bits value validation when joint stereo is used in cook decoder.
Laurent Aimar [Sat, 17 Sep 2011 14:56:35 +0000 (16:56 +0200)]
Fix js_vlc_bits value validation when joint stereo is used in cook decoder.

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

7 years agoFix potential overreads in rv34 decoder.
Laurent Aimar [Sat, 17 Sep 2011 14:56:30 +0000 (16:56 +0200)]
Fix potential overreads in rv34 decoder.

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

7 years agoCorrect determination of file size and frames in VBRI headers
Ingo Brückl [Thu, 15 Sep 2011 14:19:05 +0000 (16:19 +0200)]
Correct determination of file size and frames in VBRI headers

The fields "Number of Bytes" and "Number of Frames" are mixed up. "Bytes"
come first, "Frames" behind.

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

7 years agoh264: allow disabling bitstream overread protection by using the fast flag.
Michael Niedermayer [Wed, 14 Sep 2011 18:48:00 +0000 (20:48 +0200)]
h264: allow disabling bitstream overread protection by using the fast flag.

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

7 years agoxan: Add some buffer checks
Alex Converse [Fri, 9 Sep 2011 23:10:03 +0000 (16:10 -0700)]
xan: Add some buffer checks
(cherry picked from commit 0872bb23b4bd2d94a8ba91070f706d1bc1c3ced8)

7 years agoxan: Remove extra trailing newline
Alex Converse [Fri, 9 Sep 2011 23:13:52 +0000 (16:13 -0700)]
xan: Remove extra trailing newline
(cherry picked from commit 350f57bd7b77b36c150540ad2aae9de42cc4dfca)

7 years agoFixed size given to init_get_bits() in xan decoder.
Laurent Aimar [Fri, 9 Sep 2011 22:32:12 +0000 (00:32 +0200)]
Fixed size given to init_get_bits() in xan decoder.
(cherry picked from commit 393d5031c6aaaf8c2dda4eb5d676974c349fae85)

7 years agolibavformat/utils: print ts in the "invalid dts/pts combination" case.
Michael Niedermayer [Tue, 13 Sep 2011 02:27:41 +0000 (04:27 +0200)]
libavformat/utils: print ts in the "invalid dts/pts combination" case.

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

7 years agovf_remove_logo: domt access vf->next->query_format() directly but use the API.
Michael Niedermayer [Tue, 13 Sep 2011 01:52:30 +0000 (03:52 +0200)]
vf_remove_logo: domt access vf->next->query_format() directly but use the API.
This fixes a crash

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

7 years agosmacker: fix a few off by 1 errors
Michael Niedermayer [Mon, 12 Sep 2011 23:14:44 +0000 (01:14 +0200)]
smacker: fix a few off by 1 errors
stereo & 16bit is untested due to lack of samples

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

7 years agosmacker: add forgotten *
Michael Niedermayer [Mon, 12 Sep 2011 21:45:21 +0000 (23:45 +0200)]
smacker: add forgotten *
found by fenrir

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

7 years agosegafilm: Fix potential division by 0 on corrupted segafilm streams in the demuxer.
Laurent Aimar [Mon, 12 Sep 2011 19:09:57 +0000 (21:09 +0200)]
segafilm: Fix potential division by 0 on corrupted segafilm streams in the demuxer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
7 years agosegafilm: Check for memory allocation failures in segafilm demuxer.
Laurent Aimar [Mon, 12 Sep 2011 18:58:35 +0000 (20:58 +0200)]
segafilm: Check for memory allocation failures in segafilm demuxer.

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

7 years agorv34: check that subsequent slices have the same type as first one.
Kostya Shishkov [Mon, 12 Sep 2011 09:39:53 +0000 (11:39 +0200)]
rv34: check that subsequent slices have the same type as first one.

This prevents some crashes when corrupted bitstream reports e.g. P-type
slice in I-frame. Official RealVideo decoder demands all slices to be
of the same type too.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 23a1f0c59241465ba30103388029a7afc0ead909)

7 years agosmacker demuxer: handle possible av_realloc() failure.
Kostya Shishkov [Mon, 12 Sep 2011 07:40:42 +0000 (09:40 +0200)]
smacker demuxer: handle possible av_realloc() failure.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agogitignore: ignore .exp files, as generated by the MS linker on win32
Hendrik Leppkes [Mon, 12 Sep 2011 15:45:25 +0000 (17:45 +0200)]
gitignore: ignore .exp files, as generated by the MS linker on win32

Ignore another filetype, as generated by Microsofts lib.exe when creating the import libraries.
(cherry picked from commit 73211630110886d849e3de837ca80280a2df2b46)

7 years agormdec: Check return value of more avio_seek calls
Joakim Plate [Mon, 12 Sep 2011 02:08:06 +0000 (04:08 +0200)]
rmdec: Check return value of more avio_seek calls

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

7 years agoavidec: Check return value of more avio_seek calls
Joakim Plate [Mon, 12 Sep 2011 02:07:36 +0000 (04:07 +0200)]
avidec: Check return value of more avio_seek calls

The move of avio_seek in avi_read_seek is to avoiding modifying
state if the seek would fail.

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

7 years agoasf: Check return value of more avio_seek calls
Joakim Plate [Mon, 12 Sep 2011 02:06:55 +0000 (04:06 +0200)]
asf: Check return value of more avio_seek calls
This reduces problems when underlying protocol is not
seekable even if marked as such or if the file has been
cut short.

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

7 years agoFix writes out of bounds in the ogg demuxer.
Laurent Aimar [Sun, 11 Sep 2011 21:37:44 +0000 (23:37 +0200)]
Fix writes out of bounds in the ogg demuxer.

Between ogg_save() and ogg_restore() calls, the number of streams
could have been reduced.

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

7 years agodoc: explain __STDC_CONSTANT_MACROS in C++
Luca Barbato [Sat, 10 Sep 2011 14:23:50 +0000 (10:23 -0400)]
doc: explain __STDC_CONSTANT_MACROS in C++

In order to build C++ programs using libav you need
-D__STDC_CONSTANT_MACROS appened to the CXXFLAGS.
(cherry picked from commit d162994a81a311a8dd212a50a2d2ad2b088df97f)

7 years agogitignore: add files to git ignore generated on a win32 build
Joakim Plate [Sun, 11 Sep 2011 19:23:53 +0000 (21:23 +0200)]
gitignore: add files to git ignore generated on a win32 build

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

7 years agoFixed invalid read access on extra data in cinepak decoder.
Laurent Aimar [Sun, 11 Sep 2011 17:17:43 +0000 (19:17 +0200)]
Fixed invalid read access on extra data in cinepak decoder.

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

7 years agoFixed segfault on corrupted smacker streams in the demuxer.
Laurent Aimar [Sun, 11 Sep 2011 16:51:52 +0000 (18:51 +0200)]
Fixed segfault on corrupted smacker streams in the demuxer.

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

7 years agoFixed segfaults on corruped smacker streams in the decoder.
Laurent Aimar [Sun, 11 Sep 2011 16:54:01 +0000 (18:54 +0200)]
Fixed segfaults on corruped smacker streams in the decoder.

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

7 years agoFixed segfault on memory allocation failure in ape demuxer.
Laurent Aimar [Sun, 11 Sep 2011 17:17:40 +0000 (19:17 +0200)]
Fixed segfault on memory allocation failure in ape demuxer.

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

7 years agoh264: prevent an out of array read in decode_nal_units()
Michael Niedermayer [Sun, 11 Sep 2011 05:23:00 +0000 (07:23 +0200)]
h264: prevent an out of array read in decode_nal_units()

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

7 years agoh264dec: Prevent CABAC and CAVLC bitsteram overreading
Michael Niedermayer [Sat, 10 Sep 2011 14:28:53 +0000 (16:28 +0200)]
h264dec: Prevent CABAC and CAVLC bitsteram overreading

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

7 years agolibspeex encoder wraper
Art Clarke [Sun, 11 Sep 2011 01:14:14 +0000 (03:14 +0200)]
libspeex encoder wraper
taken from svn head of xuggle
(cherry picked from commit a52cdcd296c40882c3b4f88958990c56f0ce3019)

7 years agodvbsubdec: don't hardcode subtitle colors count in dvbsubdec to 16
Joakim Plate [Sat, 10 Sep 2011 21:12:29 +0000 (23:12 +0200)]
dvbsubdec: don't hardcode subtitle colors count in dvbsubdec to 16

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

7 years agoFixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
Laurent Aimar [Wed, 7 Sep 2011 19:43:03 +0000 (21:43 +0200)]
Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 8bfea4ab4e2cb32bc7bf6f697ee30a238c65d296)

7 years agocljr: init_get_bits size in bits instead of bytes
Alex Converse [Fri, 9 Sep 2011 21:50:33 +0000 (14:50 -0700)]
cljr: init_get_bits size in bits instead of bytes
(cherry picked from commit 0c1f5b93d9b97c4cc3684ba91a040e90bfc760d2)

7 years agoindeo2: fail if input buffer too small
Alex Converse [Fri, 9 Sep 2011 20:26:49 +0000 (13:26 -0700)]
indeo2: fail if input buffer too small
(cherry picked from commit b7ce4f1d1c3add86ece7ca595ea6c4a10b471055)

7 years agoindeo2: init_get_bits size in bits instead of bytes
Alex Converse [Fri, 9 Sep 2011 20:24:19 +0000 (13:24 -0700)]
indeo2: init_get_bits size in bits instead of bytes
(cherry picked from commit 68ca330cbd479111db9cb7649d7530ad59f04cc8)

7 years agocabac test: Change input to test, so a wider range of states is tested.
Michael Niedermayer [Sat, 10 Sep 2011 17:22:39 +0000 (19:22 +0200)]
cabac test: Change input to test, so a wider range of states is tested.

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

7 years agocabac test: match encode and decode side
Michael Niedermayer [Sat, 10 Sep 2011 17:20:28 +0000 (19:20 +0200)]
cabac test: match encode and decode side

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

7 years agocabac: fix cabac encoder
Michael Niedermayer [Sat, 10 Sep 2011 17:18:41 +0000 (19:18 +0200)]
cabac: fix cabac encoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 89653ea728bd59da2b88967ad648cce685950879)

7 years agoFixed deference of NULL pointer in motionpixels decoder.
Laurent Aimar [Sat, 10 Sep 2011 11:28:13 +0000 (13:28 +0200)]
Fixed deference of NULL pointer in motionpixels decoder.

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

7 years agoavisynth: Fix upside down bug
chinshou [Sat, 10 Sep 2011 03:23:17 +0000 (05:23 +0200)]
avisynth: Fix upside down bug
(cherry picked from commit b10ba1175d3afa28d88cf3b24b69dc4882be16f5)

7 years agoavisynth: Remove wrong pts calculation.
chinshou [Sat, 10 Sep 2011 03:21:50 +0000 (05:21 +0200)]
avisynth: Remove wrong pts calculation.
Fixes Ticket428
(cherry picked from commit 4f123a7d7c8cbf425958e726689c6bdc84605e91)

7 years agoFixed size given to init_get_bits().
Laurent Aimar [Fri, 9 Sep 2011 21:46:00 +0000 (23:46 +0200)]
Fixed size given to init_get_bits().

init_get_bits() takes a number of bits and not a number of bytes as
its size argument.

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

7 years agoFixed size given to init_get_bits() in ffv1 decoder.
Laurent Aimar [Fri, 9 Sep 2011 20:04:09 +0000 (22:04 +0200)]
Fixed size given to init_get_bits() in ffv1 decoder.

init_get_bits() takes a number of bits and not a number of bytes as
its size argument.

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

7 years agowavpack: Check error codes rather than working around error conditions.
Alex Converse [Thu, 8 Sep 2011 18:02:43 +0000 (11:02 -0700)]
wavpack: Check error codes rather than working around error conditions.
(cherry picked from commit dba2b63a98bdcac7bda1a8a2c48950518c075e17)

7 years agorc: finetune convergence failure fix
Michael Niedermayer [Fri, 9 Sep 2011 16:50:00 +0000 (18:50 +0200)]
rc: finetune convergence failure fix

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

7 years agorc: fix convergence failure
Michael Niedermayer [Fri, 9 Sep 2011 16:06:51 +0000 (18:06 +0200)]
rc: fix convergence failure

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

7 years agoFix documentation for "-debug" commandline argument
Panagiotis H.M. Issaris [Wed, 17 Aug 2011 10:20:32 +0000 (12:20 +0200)]
Fix documentation for "-debug" commandline argument
(cherry picked from commit 180e7829428e26413916f0cbc2ad85eeb1fb877e)

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

7 years agoEmploy FF_ARRAY_ELEMS instead of manually calculating array length.
Diego Biurrun [Thu, 8 Sep 2011 12:21:38 +0000 (14:21 +0200)]
Employ FF_ARRAY_ELEMS instead of manually calculating array length.
(cherry picked from commit 6376362d15ccbc02e15d0b3b7a7a5d862efd6b91)

7 years agoFixed invalid writes in wavpack decoder on corrupted bitstreams.
Laurent Aimar [Wed, 7 Sep 2011 20:17:39 +0000 (22:17 +0200)]
Fixed invalid writes in wavpack decoder on corrupted bitstreams.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0aedab03405849962b469277afe047aa2c61a87f)

7 years agoqcelpdec: fix the return value of qcelp_decode_frame().
Chris Rankin [Wed, 7 Sep 2011 09:17:30 +0000 (10:17 +0100)]
qcelpdec: fix the return value of qcelp_decode_frame().
(cherry picked from commit 04c13dca8812e8302686887b6e8201d4ad25b7d8)

7 years agojpeglsdec: fix infinite loop
Michael Niedermayer [Thu, 8 Sep 2011 03:05:11 +0000 (05:05 +0200)]
jpeglsdec: fix infinite loop
Fixes Ticket331

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

7 years agoflvdec: Remove AVFMTCTX_NOHEADER if both flags and metadata claim 1 stream
Asad Mehmood [Wed, 7 Sep 2011 22:18:07 +0000 (23:18 +0100)]
flvdec: Remove AVFMTCTX_NOHEADER if both flags and metadata claim 1 stream

If there is only 1 stream in an flv avformat_find_stream_info will continually
read until probesize is reached. This should stop it reading if the metadata
also claims there to be 1 stream.
(cherry picked from commit bcc531f04a0590732d42da133c11c138e8d08b59)

7 years agowavpack: fix wrong return value in wavpack_decode_block()
Kostya Shishkov [Mon, 5 Sep 2011 10:37:50 +0000 (12:37 +0200)]
wavpack: fix wrong return value in wavpack_decode_block()

This function should return number of samples decoded, not number of bytes
decoded.
Spotted by Uoti Urpala.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit bcd4aa8bec19a17bd633e3db13357784c05b6ca5)

7 years agoCheck extradata size on resolution change.
Reimar Döffinger [Sun, 17 Jul 2011 13:22:36 +0000 (15:22 +0200)]
Check extradata size on resolution change.

Ignore resolution change if resolution not defined in extradata.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 09c5f990bc7629dfbee8c760fd485936c60a7b40)

7 years agohttp: Fix decetion of range support in HTTP servers
Stefan Fritsch [Sat, 3 Sep 2011 20:29:07 +0000 (22:29 +0200)]
http:  Fix decetion of range support in HTTP servers

currently libavformat only allows seeking if a request with "Range:
0-" results in a 206 reply from the HTTP server which includes a
Content-Range header. But according to RFC 2616, the server may also
reply with a normal 200 reply (which is more efficient for a request
for the whole file). In fact Apache HTTPD 2.2.20 has changed the
behaviour in this way and it looks like this change will be kept in
future versions. The fix for libavformat is easy: Also look at the
Accept-Ranges header.
(cherry picked from commit 31dfc4959816aa4637e50c7f79660c75205ef84c)

7 years agoDo not free BITMAPINFOHEADER before we are done using it.
Reimar Döffinger [Sat, 27 Aug 2011 13:06:37 +0000 (15:06 +0200)]
Do not free BITMAPINFOHEADER before we are done using it.

Fixes trac ticket #396.
Completely untested.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 177aec1257d4dcde2190b6632d9c6e44e3e5c8e9)

7 years agojpegdec: set color_range
Gavin Kinsey [Thu, 1 Sep 2011 14:18:22 +0000 (16:18 +0200)]
jpegdec: set color_range
(cherry picked from commit 2f870e262e953815060de0ebea9b6653133b203e)

7 years agompeg4: fix typo in mpeg4_encode_gop_header()
Michael Niedermayer [Thu, 1 Sep 2011 00:12:15 +0000 (02:12 +0200)]
mpeg4: fix typo in mpeg4_encode_gop_header()

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

7 years agoh264: clean all non null elements of delayed_pic[]
Michael Niedermayer [Wed, 31 Aug 2011 03:04:14 +0000 (05:04 +0200)]
h264: clean all non null elements of delayed_pic[]

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

7 years agoh264: change MAX_DELAYED_PIC_COUNT check to av_assert0
Michael Niedermayer [Wed, 31 Aug 2011 03:00:39 +0000 (05:00 +0200)]
h264: change MAX_DELAYED_PIC_COUNT check to av_assert0

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

7 years agorv34: Check for invalid slice offsets
Laurent Aimar [Mon, 19 Sep 2011 20:48:53 +0000 (22:48 +0200)]
rv34: Check for invalid slice offsets

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4cc7732386eb36661ed22d1200339b38a5fa60bc)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agorv34: Fix potential overreads
Laurent Aimar [Sat, 17 Sep 2011 14:56:30 +0000 (16:56 +0200)]
rv34: Fix potential overreads

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b4ed3d78cb6c41c9d3ee5918c326ab925edd6a89)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agorv34: Avoid NULL dereference on corrupted bitstream
Laurent Aimar [Sat, 17 Sep 2011 21:43:58 +0000 (23:43 +0200)]
rv34: Avoid NULL dereference on corrupted bitstream

rv34_decode_slice() can return without allocating any pictures.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d0f6ab0298f2309c6104626787ed73416298b019)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agorv10: Reject slices that does not have the same type as the first one
Laurent Aimar [Sat, 17 Sep 2011 22:03:08 +0000 (00:03 +0200)]
rv10: Reject slices that does not have the same type as the first one

This prevents crashes with some corrupted bitstreams.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4a29b471869353c3077fb4b25b6518eb1047afb7)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agolavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
David Goldwich [Sat, 17 Sep 2011 11:50:35 +0000 (13:50 +0200)]
lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails

Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 63d64228a7f31d534e3bcae87cbd37f4a0ae2dd6)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agooggdec: fix out of bound write in the ogg demuxer
Laurent Aimar [Sun, 11 Sep 2011 21:26:12 +0000 (23:26 +0200)]
oggdec: fix out of bound write in the ogg demuxer

Between ogg_save() and ogg_restore() calls, the number of streams
could have been reduced.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 0e7efb9d23c3641d50caa288818e8c27647ce74d)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoFixed size given to init_get_bits().
Laurent Aimar [Fri, 9 Sep 2011 21:46:00 +0000 (23:46 +0200)]
Fixed size given to init_get_bits().

init_get_bits() takes a number of bits and not a number of bytes as
its size argument.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit b59efc94347ccf0cbc2ff14a5a9e99819c5bdc4d)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agosmacker: fix a few off by 1 errors
Michael Niedermayer [Tue, 13 Sep 2011 21:24:56 +0000 (23:24 +0200)]
smacker: fix a few off by 1 errors

stereo & 16bit is untested due to lack of samples

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5166376f24545207607f61ed8ff4e1b0572ff320)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoCheck for invalid VLC value in smacker decoder.
Laurent Aimar [Mon, 12 Sep 2011 21:49:36 +0000 (23:49 +0200)]
Check for invalid VLC value in smacker decoder.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6489455495fc5bfbebcfe3f57e5d4fdd6a781091)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoCheck and propagate errors when VLC trees cannot be built in smacker decoder.
Laurent Aimar [Mon, 12 Sep 2011 21:46:49 +0000 (23:46 +0200)]
Check and propagate errors when VLC trees cannot be built in smacker decoder.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 9676ffba8346791f494451e68d2a3b37a2918a9b)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoFixed off by one packet size allocation in the smacker demuxer.
Laurent Aimar [Mon, 12 Sep 2011 18:50:34 +0000 (20:50 +0200)]
Fixed off by one packet size allocation in the smacker demuxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a92d0fa5d234582583d41b67dddecffc2c819573)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoCheck for invalid packet size in the smacker demuxer.
Laurent Aimar [Mon, 12 Sep 2011 18:50:13 +0000 (20:50 +0200)]
Check for invalid packet size in the smacker demuxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoape demuxer: fix segfault on memory allocation failure.
Laurent Aimar [Sun, 11 Sep 2011 17:17:40 +0000 (19:17 +0200)]
ape demuxer: fix segfault on memory allocation failure.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 273aab99bf7be2bcda95dd64101c2317ee0fcb99)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
7 years agoxan: Add some buffer checks
Alex Converse [Fri, 9 Sep 2011 23:10:03 +0000 (16:10 -0700)]
xan: Add some buffer checks
(cherry picked from commit 0872bb23b4bd2d94a8ba91070f706d1bc1c3ced8)

Signed-off-by: Anton Khirnov <anton@khirnov.net>