summaryrefslogtreecommitdiff
path: root/libavformat/wtvenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-14 01:08:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-14 01:08:01 +0200
commit6a507ccfe5c221a183331992f4431755b87cd7c2 (patch)
treec57da15bd73bba76e96942f30810d96c67ea6ba3 /libavformat/wtvenc.c
parent438debd095e050d79425da546379814fcc7e2886 (diff)
downloadffmpeg-6a507ccfe5c221a183331992f4431755b87cd7c2.tar.gz
wtvenc: add some asserts because iam paranoid
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wtvenc.c')
-rw-r--r--libavformat/wtvenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index c0254ffba0..d638dcb205 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -20,6 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
+#include "libavutil/avassert.h"
#include "avformat.h"
#include "internal.h"
#include "wtv.h"
@@ -137,6 +138,7 @@ static void write_chunk_header(AVFormatContext *s, const ff_asf_guid *guid, int
if ((stream_id & 0x80000000) && guid != &index_guid) {
WtvChunkEntry *t = wctx->index + wctx->nb_index;
+ av_assert0(wctx->nb_index < MAX_NB_INDEX);
t->pos = wctx->last_chunk_pos;
t->serial = wctx->serial;
t->guid = guid;
@@ -607,6 +609,8 @@ static int finish_file(AVFormatContext *s, enum WtvFileIndex index, int64_t star
int64_t end_pos = avio_tell(pb);
int sector_bits, nb_sectors, pad;
+ av_assert0(index < WTV_FILES);
+
w->length = (end_pos - start_pos);
// determine optimal fat table depth, sector_bits, nb_sectors