avformat/av1: return an error when no data is provided to ff_isom_write_av1c()
authorJames Almer <jamrial@gmail.com>
Mon, 23 Jul 2018 16:15:06 +0000 (13:15 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 2 Aug 2018 15:41:53 +0000 (12:41 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/av1.c

index 7db29c8..7c55a10 100644 (file)
@@ -82,6 +82,9 @@ int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size)
     int64_t obu_size;
     int start_pos, type, temporal_id, spatial_id;
 
+    if (size <= 0)
+        return AVERROR_INVALIDDATA;
+
     while (size > 0) {
         int ret = parse_obu_header(buf, size, &obu_size, &start_pos,
                                    &type, &temporal_id, &spatial_id);