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

Andreas Cadhalpun git at videolan.org
Tue May 26 00:28:29 CEST 2015


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Mon May 25 17:17:39 2015 +0200| [83a04f8cc16f656ee14b71fd7979a48c49c4b830] | committer: Andreas Cadhalpun

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 at gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index e32f7f4..51cdd21 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;



More information about the ffmpeg-cvslog mailing list