File ffmpeg-CVE-2018-14394.patch of Package ffmpeg

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 6434f31..b57778b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5077,6 +5077,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) &&
openSUSE Build Service is sponsored by