]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/gdv.c
configure: add -lvulkan to libglslang's lib flags
[ffmpeg] / libavformat / gdv.c
index a69c349cab3c48abe60ceffd8f804b2a464369e7..b20691a2a49181dacbbb1005eb0d0e199ed2e2ef 100644 (file)
@@ -34,7 +34,7 @@ typedef struct GDVContext {
     unsigned pal[256];
 } GDVContext;
 
-static int gdv_read_probe(AVProbeData *p)
+static int gdv_read_probe(const AVProbeData *p)
 {
     if (AV_RL32(p->buf) == 0x29111994)
         return AVPROBE_SCORE_MAX;
@@ -86,6 +86,9 @@ static int gdv_read_header(AVFormatContext *ctx)
     vst->nb_frames         = avio_rl16(pb);
 
     fps = avio_rl16(pb);
+    if (!fps)
+        return AVERROR_INVALIDDATA;
+
     snd_flags = avio_rl16(pb);
     if (snd_flags & 1) {
         ast = avformat_new_stream(ctx, 0);
@@ -179,7 +182,6 @@ static int gdv_read_packet(AVFormatContext *ctx, AVPacket *pkt)
             pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
                                           AVPALETTE_SIZE);
             if (!pal) {
-                av_packet_unref(pkt);
                 return AVERROR(ENOMEM);
             }
             memcpy(pal, gdv->pal, AVPALETTE_SIZE);
@@ -191,7 +193,7 @@ static int gdv_read_packet(AVFormatContext *ctx, AVPacket *pkt)
     return 0;
 }
 
-AVInputFormat ff_gdv_demuxer = {
+const AVInputFormat ff_gdv_demuxer = {
     .name           = "gdv",
     .long_name      = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"),
     .priv_data_size = sizeof(GDVContext),