summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-05-26 14:24:37 +0100
committerLuca Barbato <lu_zero@gentoo.org>2015-05-31 13:05:12 +0200
commitcffb9ea81bd16d2ed8bce187b6bf0279c07b3b9b (patch)
tree030477c8136b3b21363924c4168589adfdaf2bfe /libavformat/mov.c
parent8e9c39e81fe5ba34010a7ba05cbe4ae31f177d89 (diff)
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. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
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 fbbfef0bf3..2cf6e8e540 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2263,6 +2263,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;