summaryrefslogtreecommitdiff
path: root/libavformat/westwood_audenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-26 14:48:33 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-26 16:46:37 +0200
commita64d4de0d44a07bcea49f24c2a8a972954e81d0a (patch)
tree4bff741ef59714909c77c61e51bedeae13b28a76 /libavformat/westwood_audenc.c
parenta6d4ea285c38e70a703602ab7d519969d2ac98a1 (diff)
avformat/westwood_audenc: Check for, not assert on invalid data
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/westwood_audenc.c')
-rw-r--r--libavformat/westwood_audenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/westwood_audenc.c b/libavformat/westwood_audenc.c
index 4ec905b088..490f2ee260 100644
--- a/libavformat/westwood_audenc.c
+++ b/libavformat/westwood_audenc.c
@@ -103,7 +103,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);