]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mov: do not overwrite extradata in mov_read_glbl()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Oct 2014 21:31:37 +0000 (23:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Oct 2014 22:17:33 +0000 (00:17 +0200)
Fixes regression from Ticket3962

This basically favors the first global header while since 34751f8313a41bf94e004ffa9491f35d96763558
it was the last. If this heuristic turns out worse, do not hesitate to revert this and
reopen 3962 as a feature request for multiple STSD

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index 8070b4d0c34e2ad8a58194508a3fef0cfd5ecd3e..fdd0671a423e61de772993dc84312dc44e68a0f6 100644 (file)
@@ -1099,6 +1099,10 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         if (type == MKTAG('f','i','e','l') && size == atom.size)
             return mov_read_default(c, pb, atom);
     }
+    if (st->codec->extradata_size > 1 && st->codec->extradata) {
+        av_log(c, AV_LOG_WARNING, "ignoring multiple glbl\n");
+        return 0;
+    }
     av_free(st->codec->extradata);
     if (ff_get_extradata(st->codec, pb, atom.size) < 0)
         return AVERROR(ENOMEM);