[FFmpeg-cvslog] mov: reject zero bytes_per_frame with non-zero samples_per_frame

Andreas Cadhalpun git at videolan.org
Mon Jun 1 00:43:58 CEST 2015


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Tue May 26 14:24:37 2015 +0100| [cffb9ea81bd16d2ed8bce187b6bf0279c07b3b9b] | committer: Luca Barbato

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 at googlemail.com>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cffb9ea81bd16d2ed8bce187b6bf0279c07b3b9b
---

 libavformat/mov.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fbbfef0..2cf6e8e 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;



More information about the ffmpeg-cvslog mailing list