X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fwestwood_audenc.c;h=e5a6e644fc0c1c5ef25aad0b069a13b0a87724e1;hb=626535f6a169e2d821b969e0ea77125ba7482113;hp=4ec905b088e5961b7f59133e5084d987d49622de;hpb=4236e87f502e68acb949ea4ae6f5ebd889377b60;p=ffmpeg diff --git a/libavformat/westwood_audenc.c b/libavformat/westwood_audenc.c index 4ec905b088e..e5a6e644fc0 100644 --- a/libavformat/westwood_audenc.c +++ b/libavformat/westwood_audenc.c @@ -73,7 +73,6 @@ static int wsaud_write_header(AVFormatContext *ctx) AVStream *st = ctx->streams[0]; AVIOContext *pb = ctx->pb; AUDMuxContext *a = ctx->priv_data; - int ret; unsigned char flags = 0; a->uncomp_size = 0; @@ -103,7 +102,8 @@ static int wsaud_write_packet(AVFormatContext *ctx, AVPacket *pkt) AVIOContext *pb = ctx->pb; AUDMuxContext *a = ctx->priv_data; - av_assert1(pkt->size < UINT16_MAX && (pkt->size * 4) < UINT16_MAX); + if (pkt->size > UINT16_MAX / 4) + return AVERROR_INVALIDDATA; /* Assumes ADPCM since this muxer doesn't support SND1 or PCM format. */ avio_wl16(pb, pkt->size); avio_wl16(pb, pkt->size * 4);