Commit 4907f813 authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer

Reject audio tracks with invalid interleaver parameters in RM demuxer.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 352c878d
...@@ -215,8 +215,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, ...@@ -215,8 +215,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
ast->audio_framesize = st->codec->block_align; ast->audio_framesize = st->codec->block_align;
st->codec->block_align = coded_framesize; st->codec->block_align = coded_framesize;
if(ast->audio_framesize >= UINT_MAX / sub_packet_h){ if (ast->audio_framesize <= 0 || sub_packet_h <= 0 ||
av_log(s, AV_LOG_ERROR, "ast->audio_framesize * sub_packet_h too large\n"); ast->audio_framesize >= UINT_MAX / sub_packet_h){
av_log(s, AV_LOG_ERROR, "ast->audio_framesize * sub_packet_h is invalid\n");
return -1; return -1;
} }
...@@ -252,8 +253,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, ...@@ -252,8 +253,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
if ((ret = rm_read_extradata(pb, st->codec, codecdata_length)) < 0) if ((ret = rm_read_extradata(pb, st->codec, codecdata_length)) < 0)
return ret; return ret;
if(ast->audio_framesize >= UINT_MAX / sub_packet_h){ if (ast->audio_framesize <= 0 || sub_packet_h <= 0 ||
av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h too large\n"); ast->audio_framesize >= UINT_MAX / sub_packet_h){
av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h is invalid\n");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment