diff --git a/avilib-0.6.10/avilib.c b/avilib-0.6.10/avilib.c index 87510bcf0..7041c124b 100644 --- a/avilib-0.6.10/avilib.c +++ b/avilib-0.6.10/avilib.c @@ -2470,6 +2470,11 @@ long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0; + if (vidbuf == NULL) { + AVI->video_pos++; + return n; + } + lseek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET); if (avi_read(AVI->fdes,vidbuf,n) != n) diff --git a/avilib/avilib.c b/avilib/avilib.c index 84e322638..e22815ec1 100644 --- a/avilib/avilib.c +++ b/avilib/avilib.c @@ -1687,6 +1687,11 @@ long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0; + if (vidbuf == NULL) { + AVI->video_pos++; + return n; + } + lseek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET); if (avi_read(AVI->fdes,vidbuf,n) != n)