aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-05-25 17:17:39 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-05-26 00:28:02 +0200
commit83a04f8cc16f656ee14b71fd7979a48c49c4b830 (patch)
tree78a558930c3253dd9f0566f46711e02910769947 /libavformat/mov.c
parent3232ac4bac05ff788ece2f7344100e4431edfa87 (diff)
downloadffmpeg-83a04f8cc16f656ee14b71fd7979a48c49c4b830.tar.gz
mov: reject zero bytes_per_frame with non-zero samples_per_frame
In this case the mov demuxer can return a large number of empty packets. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e32f7f436d..51cdd21abd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2587,6 +2587,13 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
AVIndexEntry *e;
unsigned size, samples;
+ if (sc->samples_per_frame > 1 && !sc->bytes_per_frame) {
+ avpriv_request_sample(mov->fc,
+ "Zero bytes per frame, but %d samples per frame",
+ sc->samples_per_frame);
+ return;
+ }
+
if (sc->samples_per_frame >= 160) { // gsm
samples = sc->samples_per_frame;
size = sc->bytes_per_frame;