changeset 1970:a27976be3394 libavformat

Do not return invalid pointer for non-audio or video streams. Patch by Sam Hocevar sam+ffmpeg zoy org
author rtogni
date Fri, 30 Mar 2007 23:04:45 +0000
parents f7b57a2fa7ca
children 363dcd1e64e0
files rm.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rm.c	Fri Mar 30 22:10:25 2007 +0000
+++ b/rm.c	Fri Mar 30 23:04:45 2007 +0000
@@ -954,9 +954,8 @@
                 len=len2;
             rm->remaining_len-= len;
             av_get_packet(pb, pkt, len);
-        }
 
-        if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
+        } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
             if ((st->codec->codec_id == CODEC_ID_RA_288) ||
                 (st->codec->codec_id == CODEC_ID_COOK)) {
                 int x;
@@ -1008,7 +1007,9 @@
                 }
             } else
                 av_get_packet(pb, pkt, len);
-        }
+
+        } else
+            av_get_packet(pb, pkt, len);
 
         if(  (st->discard >= AVDISCARD_NONKEY && !(flags&2))
            || st->discard >= AVDISCARD_ALL){