]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rpl.c
smackerdemuxer: check some values before instead of just after malloc()
[ffmpeg] / libavformat / rpl.c
index b8214e360414a7cc5f0282d6e6f9474e7cfd9e49..9816cb7c30e2346d7d6db2ff2e6bcea99360ba2f 100644 (file)
@@ -22,6 +22,7 @@
 #include "libavutil/avstring.h"
 #include "libavutil/dict.h"
 #include "avformat.h"
+#include "internal.h"
 #include <stdlib.h>
 
 #define RPL_SIGNATURE "ARMovie\x0A"
@@ -149,7 +150,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
     vst->codec->bits_per_coded_sample = read_line_and_int(pb, &error);  // video bits per sample
     error |= read_line(pb, line, sizeof(line));                   // video frames per second
     fps = read_fps(line, &error);
-    av_set_pts_info(vst, 32, fps.den, fps.num);
+    avpriv_set_pts_info(vst, 32, fps.den, fps.num);
 
     // Figure out the video codec
     switch (vst->codec->codec_tag) {
@@ -163,11 +164,9 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
             // The header is wrong here, at least sometimes
             vst->codec->bits_per_coded_sample = 16;
             break;
-#if 0
         case 130:
             vst->codec->codec_id = CODEC_ID_ESCAPE130;
             break;
-#endif
         default:
             av_log(s, AV_LOG_WARNING,
                    "RPL video format %i not supported yet!\n",
@@ -226,7 +225,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
                    "RPL audio format %i not supported yet!\n",
                    audio_format);
         }
-        av_set_pts_info(ast, 32, 1, ast->codec->bit_rate);
+        avpriv_set_pts_info(ast, 32, 1, ast->codec->bit_rate);
     } else {
         for (i = 0; i < 3; i++)
             error |= read_line(pb, line, sizeof(line));