summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/movenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b6cea27440..1e4b7a1309 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4785,6 +4785,11 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
else
samples_in_chunk = 1;
+ if (samples_in_chunk < 1) {
+ av_log(s, AV_LOG_ERROR, "fatal error, input packet contains no samples\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
/* copy extradata if it exists */
if (trk->vos_len == 0 && par->extradata_size > 0 &&
!TAG_IS_AVCI(trk->tag) &&