]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dv.c
Merge commit '9deaec782810d098bca11c9332fab2d2f4c5fb78'
[ffmpeg] / libavformat / dv.c
index 0a893f482e0aec571643ab6a6fbb859e3aff05d8..485a5f874278988b53ca32e91c871bf85581ce1f 100644 (file)
@@ -425,7 +425,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
     const AVDVProfile *sys = av_dv_codec_profile2(c->vst->codec->width, c->vst->codec->height,
                                                  c->vst->codec->pix_fmt, c->vst->codec->time_base);
     int64_t offset;
-    int64_t size       = avio_size(s->pb) - s->data_offset;
+    int64_t size       = avio_size(s->pb) - s->internal->data_offset;
     int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
 
     offset = sys->frame_size * timestamp;
@@ -435,7 +435,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
     else if (offset < 0)
         offset = 0;
 
-    return offset + s->data_offset;
+    return offset + s->internal->data_offset;
 }
 
 void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
@@ -472,6 +472,9 @@ static int dv_read_timecode(AVFormatContext *s) {
                                         partial_frame_size);
 
     RawDVContext *c = s->priv_data;
+    if (!partial_frame)
+        return AVERROR(ENOMEM);
+
     ret = avio_read(s->pb, partial_frame, partial_frame_size);
     if (ret < 0)
         goto finish;