OSDN Git Service

avformat/flvdec: fix potential use of uninitialized variables
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Dec 2014 12:30:51 +0000 (13:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Dec 2014 12:40:20 +0000 (13:40 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/flvdec.c

index 17d1313..c64b3a9 100644 (file)
@@ -459,11 +459,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
     }
 
     if (key) {
+        acodec = astream ? astream->codec : NULL;
+        vcodec = vstream ? vstream->codec : NULL;
+
         // stream info doesn't live any deeper than the first object
         if (depth == 1) {
-            acodec = astream ? astream->codec : NULL;
-            vcodec = vstream ? vstream->codec : NULL;
-
             if (amf_type == AMF_DATA_TYPE_NUMBER ||
                 amf_type == AMF_DATA_TYPE_BOOL) {
                 if (!strcmp(key, "duration"))