# HG changeset patch # User michael # Date 1225239410 0 # Node ID 2e7994e4510083422df2209b53ad4429fb0fd57b # Parent ca3996178741f6b06560f0256dbf7cb41ef55cac Check sub_packet_size against 0 to avoid div by zero later. Fixes issue473 diff -r ca3996178741 -r 2e7994e45100 rmdec.c --- a/rmdec.c Tue Oct 28 23:49:04 2008 +0000 +++ b/rmdec.c Wed Oct 29 00:16:50 2008 +0000 @@ -138,6 +138,11 @@ 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;