aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2025-08-03 13:30:42 -0300
committerJames Almer <jamrial@gmail.com>2025-08-06 10:37:01 -0300
commit2681eede9c5a859bf43b997cc1222905eac4ec02 (patch)
tree0a5bd5aa0a2921df89656941eb9e8631abe590c6 /libavformat/mov.c
parent399c766d2a8b3eb8f612bcfd53f14ac3f9c23cb0 (diff)
downloadffmpeg-master.tar.gz
avformat/mov: set primary extradata based on the first Sample only if it's not already in placeHEADmaster
If the first Sample references the first stsd entry, then setting it here is redundant. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index be52f53c0c..7015329520 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10684,9 +10684,9 @@ static int mov_read_header(AVFormatContext *s)
uint32_t dvdsub_clut[FF_DVDCLUT_CLUT_LEN] = {0};
fix_timescale(mov, sc);
- /* Set the primary extradata based on the first Sample. */
+ /* Set the primary extradata based on the first Sample if it doesn't reference the first stsd entry. */
if (sc->stsc_count && sc->extradata_size && !sc->iamf &&
- sc->stsc_data[0].id > 0 && sc->stsc_data[0].id <= sc->stsd_count) {
+ sc->stsc_data[0].id > 1 && sc->stsc_data[0].id <= sc->stsd_count) {
sc->last_stsd_index = sc->stsc_data[0].id - 1;
av_freep(&st->codecpar->extradata);
st->codecpar->extradata_size = sc->extradata_size[sc->last_stsd_index];