The specification states "NSV files may contain a single file header. "
Fixes: out of array access
Fixes: nsv-asan-002f473f726a0dcbd3bd53e422c4fc40b3cf3421
Found-by: Paul Ch <paulcher@icloud.com>
Tested-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
int16_t avsync;
AVRational framerate;
uint32_t *nsvs_timestamps;
+ int nsvf;
} NSVContext;
static const AVCodecTag nsv_codec_video_tags[] = {
nsv->state = NSV_UNSYNC; /* in case we fail */
+ if (nsv->nsvf) {
+ av_log(s, AV_LOG_TRACE, "Multiple NSVf\n");
+ return 0;
+ }
+ nsv->nsvf = 1;
+
size = avio_rl32(pb);
if (size < 28)
return -1;