Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit fd06291239c1bb616bf303b5696cc432710b2530)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
... | ... |
@@ -1171,6 +1171,9 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, |
1171 | 1171 |
int frame_size, ret, frame_flags; |
1172 | 1172 |
int samplecount = 0; |
1173 | 1173 |
|
1174 |
+ if (avpkt->size < 12 + s->multichannel * 4) |
|
1175 |
+ return AVERROR_INVALIDDATA; |
|
1176 |
+ |
|
1174 | 1177 |
s->block = 0; |
1175 | 1178 |
s->ch_offset = 0; |
1176 | 1179 |
|