diff mbox series

[FFmpeg-devel,6/6] avformat/argo_brp: use header frame counts

Message ID 20200926023817.7891-6-zane@zanevaniperen.com
State Accepted
Commit ce30c3d5b9601ccb7d94ce0cc7ffe947264509cb
Headers show
Series [FFmpeg-devel,1/6] avformat/argo_{asf, brp}: fix potential segfault in ff_argo_asf_fill_stream() | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zane van Iperen Sept. 26, 2020, 2:39 a.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavformat/argo_brp.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c
index af64a0d6dc..76b4da2e66 100644
--- a/libavformat/argo_brp.c
+++ b/libavformat/argo_brp.c
@@ -237,6 +237,8 @@  static int argo_brp_read_header(AVFormatContext *s)
                 avpriv_request_sample(s, "depth == %u", bvid->depth);
                 return AVERROR_PATCHWELCOME;
             }
+
+            st->nb_frames = bvid->num_frames;
         } else if (hdr->codec_id == BRP_CODEC_ID_BASF) {
             /*
              * It would make the demuxer significantly more complicated
@@ -255,6 +257,8 @@  static int argo_brp_read_header(AVFormatContext *s)
 
             if ((ret = ff_argo_asf_validate_file_header(s, &hdr->extradata.basf)) < 0)
                 return ret;
+
+            st->nb_frames = hdr->extradata.basf.num_chunks;
         } else if (hdr->codec_id == BRP_CODEC_ID_MASK) {
             ArgoMASKHeader *mask = &hdr->extradata.mask;