mpegts_audio_write: fix potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-06-03 03:42:50 +02:00
parent f67309cabe
commit 328e203ca9

View File

@ -507,7 +507,7 @@ static void section_write_packet(MpegTSSection *s, const uint8_t *packet)
static int mpegts_audio_write(void *opaque, uint8_t *buf, int size)
{
MpegTSWriteStream *ts_st = (MpegTSWriteStream *)opaque;
if (ts_st->adata_pos + size > ts_st->adata_size)
if (ts_st->adata_pos + (int64_t)size > ts_st->adata_size)
return AVERROR(EIO);
memcpy(ts_st->adata + ts_st->adata_pos, buf, size);