]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/filmstripdec.c
rtpenc_mpegts: Free the right ->pb in the error path in the init function
[ffmpeg] / libavformat / filmstripdec.c
index 1a3b947ec76f2a54795ad0b4fb94f4ed9a326149..c82656e72f98b43835021817a4ea8edb9d270f40 100644 (file)
@@ -30,7 +30,7 @@
 
 #define RAND_TAG MKBETAG('R','a','n','d')
 
-typedef struct {
+typedef struct FilmstripDemuxContext {
     int leading;
 } FilmstripDemuxContext;
 
@@ -55,14 +55,14 @@ static int read_header(AVFormatContext *s)
 
     st->nb_frames = avio_rb32(pb);
     if (avio_rb16(pb) != 0) {
-        av_log_ask_for_sample(s, "unsupported packing method\n");
-        return AVERROR_INVALIDDATA;
+        avpriv_request_sample(s, "Unsupported packing method");
+        return AVERROR_PATCHWELCOME;
     }
 
     avio_skip(pb, 2);
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = CODEC_ID_RAWVIDEO;
-    st->codec->pix_fmt    = PIX_FMT_RGBA;
+    st->codec->codec_id   = AV_CODEC_ID_RAWVIDEO;
+    st->codec->pix_fmt    = AV_PIX_FMT_RGBA;
     st->codec->codec_tag  = 0; /* no fourcc */
     st->codec->width      = avio_rb16(pb);
     st->codec->height     = avio_rb16(pb);
@@ -84,7 +84,7 @@ static int read_packet(AVFormatContext *s,
         return AVERROR(EIO);
     pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4);
     pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4);
-    avio_skip(s->pb, st->codec->width * film->leading * 4);
+    avio_skip(s->pb, st->codec->width * (int64_t) film->leading * 4);
     if (pkt->size < 0)
         return pkt->size;
     pkt->flags |= AV_PKT_FLAG_KEY;
@@ -106,5 +106,5 @@ AVInputFormat ff_filmstrip_demuxer = {
     .read_header    = read_header,
     .read_packet    = read_packet,
     .read_seek      = read_seek,
-    .extensions = "flm",
+    .extensions     = "flm",
 };