Commit 6a507ccf authored by Michael Niedermayer's avatar Michael Niedermayer

wtvenc: add some asserts because iam paranoid

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 438debd0
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
#include "wtv.h" #include "wtv.h"
...@@ -137,6 +138,7 @@ static void write_chunk_header(AVFormatContext *s, const ff_asf_guid *guid, int ...@@ -137,6 +138,7 @@ static void write_chunk_header(AVFormatContext *s, const ff_asf_guid *guid, int
if ((stream_id & 0x80000000) && guid != &index_guid) { if ((stream_id & 0x80000000) && guid != &index_guid) {
WtvChunkEntry *t = wctx->index + wctx->nb_index; WtvChunkEntry *t = wctx->index + wctx->nb_index;
av_assert0(wctx->nb_index < MAX_NB_INDEX);
t->pos = wctx->last_chunk_pos; t->pos = wctx->last_chunk_pos;
t->serial = wctx->serial; t->serial = wctx->serial;
t->guid = guid; t->guid = guid;
...@@ -607,6 +609,8 @@ static int finish_file(AVFormatContext *s, enum WtvFileIndex index, int64_t star ...@@ -607,6 +609,8 @@ static int finish_file(AVFormatContext *s, enum WtvFileIndex index, int64_t star
int64_t end_pos = avio_tell(pb); int64_t end_pos = avio_tell(pb);
int sector_bits, nb_sectors, pad; int sector_bits, nb_sectors, pad;
av_assert0(index < WTV_FILES);
w->length = (end_pos - start_pos); w->length = (end_pos - start_pos);
// determine optimal fat table depth, sector_bits, nb_sectors // determine optimal fat table depth, sector_bits, nb_sectors
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment