aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-10-29 00:16:50 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-10-29 00:16:50 +0000
commitf23938f5b799e8859693aec1ce55ef04490c6aab (patch)
treedb81dc602aa9b8f05be70bc415e900de9a27858f /libavformat/rmdec.c
parent8ff8de73a4853a1f00baab707021bde7988f97bb (diff)
downloadffmpeg-f23938f5b799e8859693aec1ce55ef04490c6aab.tar.gz
Check sub_packet_size against 0 to avoid div by zero later.
Fixes issue473 Originally committed as revision 15739 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 8442957400..9db09e1ed9 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -138,6 +138,11 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
return -1;
}
+ if(sub_packet_size <= 0){
+ av_log(s, AV_LOG_ERROR, "sub_packet_size is invalid\n");
+ return -1;
+ }
+
if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK;
else if (!strcmp(buf, "sipr")) st->codec->codec_id = CODEC_ID_SIPR;
else st->codec->codec_id = CODEC_ID_ATRAC3;