diff mbox series

[FFmpeg-devel] Fix crash when trying to get a fragment time for a non-existing fragment

Message ID 20241025015410.36165-1-ezemtsov@google.com
State New
Headers show
Series [FFmpeg-devel] Fix crash when trying to get a fragment time for a non-existing fragment | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Eugene Zemtsov Oct. 25, 2024, 1:54 a.m. UTC
From: Eugene Zemtsov <eugene@chromium.org>

Bug: https://issues.chromium.org/issues/372994341
Change-Id: I695d625717c078ed6f84f44e58c34da858af4d3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/5958151
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b4390be44f..f213fd5b22 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1672,6 +1672,8 @@  static int64_t get_frag_time(AVFormatContext *s, AVStream *dst_st,
     // to fragments that referenced this stream in the sidx
     if (sc->has_sidx) {
         frag_stream_info = get_frag_stream_info(frag_index, index, sc->id);
+        if (!frag_stream_info)
+            return AV_NOPTS_VALUE;
         if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE)
             return frag_stream_info->sidx_pts;
         if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE)