ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Mon 
Jun  3 00:16:18 2024 +0200| [f10493f6fc2a79f706138d90420a4369b9655a47] | 
committer: Michael Niedermayer

avformat/imfdec: Simplify get_next_track_with_minimum_timestamp()

This also makes the code more robust

Fixes: CID1512414 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Reviewed-by: Pierre-Anthony Lemieux <p...@sandflow.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f10493f6fc2a79f706138d90420a4369b9655a47
---

 libavformat/imfdec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 32208f89cc..a86b4763ff 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -695,12 +695,9 @@ static int imf_read_header(AVFormatContext *s)
 static IMFVirtualTrackPlaybackCtx 
*get_next_track_with_minimum_timestamp(AVFormatContext *s)
 {
     IMFContext *c = s->priv_data;
-    IMFVirtualTrackPlaybackCtx *track;
+    IMFVirtualTrackPlaybackCtx *track = NULL;
     AVRational minimum_timestamp = av_make_q(INT32_MAX, 1);
 
-    if (!c->track_count)
-        return NULL;
-
     for (uint32_t i = c->track_count; i > 0; i--) {
         av_log(s, AV_LOG_TRACE, "Compare track %d timestamp " AVRATIONAL_FORMAT
                " to minimum " AVRATIONAL_FORMAT

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to