]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dsicin.c
Replace PATCHWELCOME by relevant error codes.
[ffmpeg] / libavformat / dsicin.c
index ab098dc017f0950c63d306c35ec9bd8c8ba66ddf..e0db8ba10ed5d516aa0de0d4b6ce693305be3516 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
+#include "internal.h"
+#include "avio_internal.h"
 
 
 typedef struct CinFileHeader {
@@ -111,7 +113,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (!st)
         return AVERROR(ENOMEM);
 
-    av_set_pts_info(st, 32, 1, 12);
+    avpriv_set_pts_info(st, 32, 1, 12);
     cin->video_stream_index = st->index;
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codec->codec_id = CODEC_ID_DSICINVIDEO;
@@ -124,7 +126,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (!st)
         return AVERROR(ENOMEM);
 
-    av_set_pts_info(st, 32, 1, 22050);
+    avpriv_set_pts_info(st, 32, 1, 22050);
     cin->audio_stream_index = st->index;
     st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_DSICINAUDIO;
@@ -178,6 +180,8 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
         /* palette and video packet */
         pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size;
 
+        pkt_size = ffio_limit(pb, pkt_size);
+
         ret = av_new_packet(pkt, 4 + pkt_size);
         if (ret < 0)
             return ret;