diff rmdec.c @ 4014:2e7994e45100 libavformat

Check sub_packet_size against 0 to avoid div by zero later. Fixes issue473
author michael
date Wed, 29 Oct 2008 00:16:50 +0000
parents 4928ebaaf2bd
children 1349c277efbd
line wrap: on
line diff
--- 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;