OSDN Git Service

mxfdec: Check eof_reached in mxf_read_local_tags()
authorTomas Härdin <tomas.hardin@codemill.se>
Thu, 26 Jan 2012 12:21:35 +0000 (13:21 +0100)
committerDiego Biurrun <diego@biurrun.de>
Thu, 9 Feb 2012 11:41:50 +0000 (12:41 +0100)
This fixes an infinite loop with zzuf2.mxf.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavformat/mxfdec.c

index 7b61168..fd40fdb 100644 (file)
@@ -1471,7 +1471,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
 
     if (!ctx)
         return AVERROR(ENOMEM);
-    while (avio_tell(pb) + 4 < klv_end) {
+    while (avio_tell(pb) + 4 < klv_end && !pb->eof_reached) {
         int ret;
         int tag = avio_rb16(pb);
         int size = avio_rb16(pb); /* KLV specified by 0x53 */