[CVE patch] CVE-2016-2636 in libav version 11.7 95/76195/1 accepted/tizen/common/20160627.191537 accepted/tizen/common/20160629.222525 accepted/tizen/ivi/20160629.020735 accepted/tizen/mobile/20160629.020842 accepted/tizen/tv/20160629.020755 accepted/tizen/wearable/20160629.020818 submit/tizen/20160623.064645 submit/tizen/20160628.080717
authorJiyong Min <jiyong.min@samsung.com>
Thu, 23 Jun 2016 06:21:19 +0000 (15:21 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Thu, 23 Jun 2016 06:22:52 +0000 (15:22 +0900)
 - asfenc: fix some possible integer overflows (CVE-2016-2326)

Change-Id: I9904997efff6a91ed4c74d4135611c04a63e637f
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
libavformat/asfenc.c

index 4ae52bd..4cd1a4a 100644 (file)
@@ -410,7 +410,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
     avio_wl64(pb, unix_to_file_time(file_time));
     avio_wl64(pb, asf->nb_packets); /* number of packets */
     avio_wl64(pb, play_duration); /* end time stamp (in 100ns units) */
-    avio_wl64(pb, send->duration); /* duration (in 100ns units) */
+    avio_wl64(pb, send_duration); /* duration (in 100ns units) */
     avio_wl64(pb, PREROLL_TIME); /* start time stamp */
     avio_wl32(pb, (asf->is_streamed || !pb->seekable) ? 3 : 2);  /* ??? */
     avio_wl32(pb, s->packet_size); /* packet size */
@@ -869,10 +869,6 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
             return AVERROR(ERANGE);
 
         start_sec = pts / 1000;
-        if (start_sec != asf->last_indexed_pts / 1000) {        if (pts / 1000LL > INT_MAX)
-            return AVERROR(ERANGE);
-
-        start_sec = pts / 1000;
         if (start_sec != asf->last_indexed_pts / 1000) {
             for (i = asf->nb_index_count; i < start_sec; i++) {
                 if (i >= asf->nb_index_memory_alloc) {