matroskadec: check h in generic rm packet shuffler

Fixes crash

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/6/merge
Michael Niedermayer 12 years ago
parent 1f41cffe1e
commit c2ca0163af
  1. 2
      libavformat/matroskadec.c

@ -2032,7 +2032,7 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
}
memcpy(track->audio.buf + y*w, data, w);
} else {
if (size < sps * w / sps) {
if (size < sps * w / sps || h<=0) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt generic RM-style audio packet size\n");
return AVERROR_INVALIDDATA;

Loading…
Cancel
Save