Fixes: signed integer overflow: -3468545475927866368 * 4 cannot be represented in type 'long' Fixes: 28879/clusterfuzz-testcase-minimized-ffmpeg_dem_NUV_fuzzer-6303367307591680
Unified · Split
| @@ -117,6 +117,10 @@ static int get_codec_data(AVFormatContext *s, AVIOContext *pb, AVStream *vst, · 116 unmodified lines | |||
| 117 | ast->codecpar->bits_per_coded_sample = avio_rl32(pb); | 117 | ast->codecpar->bits_per_coded_sample = avio_rl32(pb); |
| 118 | ast->codecpar->channels = avio_rl32(pb); | 118 | ast->codecpar->channels = avio_rl32(pb); |
| 119 | ast->codecpar->channel_layout = 0; | 119 | ast->codecpar->channel_layout = 0; |
| 120 | if (ast->codecpar->channels <= 0) { | ||
| 121 | av_log(s, AV_LOG_ERROR, "Invalid channels %d\n", ast->codecpar->channels); | ||
| 122 | return AVERROR_INVALIDDATA; | ||
| 123 | } | ||
| 120 | 124 | ||
| 121 | id = ff_wav_codec_get_id(ast->codecpar->codec_tag, | 125 | id = ff_wav_codec_get_id(ast->codecpar->codec_tag, |
| 122 | ast->codecpar->bits_per_coded_sample); | 126 | ast->codecpar->bits_per_coded_sample); |