Mercurial > libavformat.hg
comparison matroskadec.c @ 6127:f9967eb0abfd libavformat
matroskadec: fix type of the length field in ebml_read_master()
Also use the correct value for unknown size (instead of a truncated
and sign extended value).
author | aurel |
---|---|
date | Fri, 11 Jun 2010 17:16:43 +0000 |
parents | 72bfd56f9a18 |
children | 9df581584d50 |
comparison
equal
deleted
inserted
replaced
6126:72bfd56f9a18 | 6127:f9967eb0abfd |
---|---|
655 /* | 655 /* |
656 * Read the next element, but only the header. The contents | 656 * Read the next element, but only the header. The contents |
657 * are supposed to be sub-elements which can be read separately. | 657 * are supposed to be sub-elements which can be read separately. |
658 * 0 is success, < 0 is failure. | 658 * 0 is success, < 0 is failure. |
659 */ | 659 */ |
660 static int ebml_read_master(MatroskaDemuxContext *matroska, int length) | 660 static int ebml_read_master(MatroskaDemuxContext *matroska, uint64_t length) |
661 { | 661 { |
662 ByteIOContext *pb = matroska->ctx->pb; | 662 ByteIOContext *pb = matroska->ctx->pb; |
663 MatroskaLevel *level; | 663 MatroskaLevel *level; |
664 | 664 |
665 if (matroska->num_levels >= EBML_MAX_DEPTH) { | 665 if (matroska->num_levels >= EBML_MAX_DEPTH) { |
716 for (i=0; syntax[i].id; i++) | 716 for (i=0; syntax[i].id; i++) |
717 if (id == syntax[i].id) | 717 if (id == syntax[i].id) |
718 break; | 718 break; |
719 if (!syntax[i].id && id == MATROSKA_ID_CLUSTER && | 719 if (!syntax[i].id && id == MATROSKA_ID_CLUSTER && |
720 matroska->num_levels > 0 && | 720 matroska->num_levels > 0 && |
721 matroska->levels[matroska->num_levels-1].length == 0xffffffffffffffff) | 721 matroska->levels[matroska->num_levels-1].length == 0xffffffffffffff) |
722 return 0; // we reached the end of an unknown size cluster | 722 return 0; // we reached the end of an unknown size cluster |
723 if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) | 723 if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) |
724 av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); | 724 av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id); |
725 return ebml_parse_elem(matroska, &syntax[i], data); | 725 return ebml_parse_elem(matroska, &syntax[i], data); |
726 } | 726 } |