[libav-commits] hdsenc: Avoid integer overflow

Michael Niedermayer git at libav.org
Sat Dec 14 16:51:49 CET 2013


Module: libav
Branch: master
Commit: 417927af3c99bc17819995aa57ae05685deeace8

Author:    Michael Niedermayer <michaelni at gmx.at>
Committer: Martin Storsjö <martin at martin.st>
Date:      Wed Dec 11 16:33:26 2013 +0100

hdsenc: Avoid integer overflow

Also remove a silly leftover pair of parentheses.

Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/hdsenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 6d5b127..ea6e77c 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -509,7 +509,7 @@ static int hds_write_packet(AVFormatContext *s, AVPacket *pkt)
     HDSContext *c = s->priv_data;
     AVStream *st = s->streams[pkt->stream_index];
     OutputStream *os = &c->streams[s->streams[pkt->stream_index]->id];
-    int64_t end_dts = (os->fragment_index) * c->min_frag_duration;
+    int64_t end_dts = os->fragment_index * (int64_t) c->min_frag_duration;
     int ret;
 
     if (st->first_dts == AV_NOPTS_VALUE)



More information about the libav-commits mailing list