Check return value of get_chunk_header(). Since enum can be unsigned, the
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 29 Sep 2010 15:43:36 +0000 (15:43 +0000)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 29 Sep 2010 15:43:36 +0000 (15:43 +0000)
current code wouldn't always error out on errors.

Based on patch by Stephen d'Angelo <sdangelo evertz com>.

Originally committed as revision 25260 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mmsh.c

index dbbaab6..3581431 100644 (file)
@@ -147,9 +147,9 @@ static int get_http_header_data(MMSHContext *mmsh)
 
     for (;;) {
         len = 0;
-        chunk_type = get_chunk_header(mmsh, &len);
-        if (chunk_type < 0) {
-            return chunk_type;
+        res = chunk_type = get_chunk_header(mmsh, &len);
+        if (res < 0) {
+            return res;
         } else if (chunk_type == CHUNK_TYPE_ASF_HEADER){
             // get asf header and stored it
             if (!mms->header_parsed) {