Skip to content

Commit

Permalink
oggparseogm: check timing variables
Browse files Browse the repository at this point in the history
Fixes a potential divide by zero.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:[email protected]
  • Loading branch information
elenril committed Jan 6, 2014
1 parent 8058284 commit 75647de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavformat/oggparseogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ ogm_header(AVFormatContext *s, int idx)

time_unit = bytestream2_get_le64(&p);
spu = bytestream2_get_le64(&p);
if (!time_unit || !spu) {
av_log(s, AV_LOG_ERROR, "Invalid timing values.\n");
return AVERROR_INVALIDDATA;
}

bytestream2_skip(&p, 4); /* default_len */
bytestream2_skip(&p, 8); /* buffersize + bits_per_sample */

Expand Down

0 comments on commit 75647de

Please sign in to comment.