]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/cinedec.c
avfilter: Remove deprecated avfilter_link_get_channels
[ffmpeg] / libavformat / cinedec.c
index d27ebbba7bf949c049ac1228d88a75f325404992..e5c6468c39154787b343186f92fe0afb42ac0d7f 100644 (file)
@@ -168,6 +168,10 @@ static int cine_read_header(AVFormatContext *avctx)
     avio_skip(pb, 616); // Binning .. bFlipH
     if (!avio_rl32(pb) ^ vflip) {
         st->codecpar->extradata  = av_strdup("BottomUp");
+        if (!st->codecpar->extradata) {
+            st->codecpar->extradata_size = 0;
+            return AVERROR(ENOMEM);
+        }
         st->codecpar->extradata_size  = 9;
     }
 
@@ -284,10 +288,10 @@ static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     AVIOContext *pb = avctx->pb;
     int n, size, ret;
 
-    if (cine->pts >= st->duration)
+    if (cine->pts >= st->internal->nb_index_entries)
         return AVERROR_EOF;
 
-    avio_seek(pb, st->index_entries[cine->pts].pos, SEEK_SET);
+    avio_seek(pb, st->internal->index_entries[cine->pts].pos, SEEK_SET);
     n = avio_rl32(pb);
     if (n < 8)
         return AVERROR_INVALIDDATA;