#include <string.h>
#include "libavutil/imgutils.h"
+#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "get_bits.h"
int ret;
AVRational fps, aspect;
+ if (get_bits_left(gb) < 206)
+ return AVERROR_INVALIDDATA;
+
s->theora_header = 0;
s->theora = get_bits(gb, 24);
av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);