@ -5916,8 +5916,10 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log ( c - > fc , AV_LOG_WARNING , " Unsupported Mastering Display Metadata box version %d \n " , version ) ;
av_log ( c - > fc , AV_LOG_WARNING , " Unsupported Mastering Display Metadata box version %d \n " , version ) ;
return 0 ;
return 0 ;
}
}
if ( sc - > mastering )
if ( sc - > mastering ) {
return AVERROR_INVALIDDATA ;
av_log ( c - > fc , AV_LOG_WARNING , " Ignoring duplicate Mastering Display Metadata \n " ) ;
return 0 ;
}
avio_skip ( pb , 3 ) ; /* flags */
avio_skip ( pb , 3 ) ; /* flags */
@ -5954,11 +5956,16 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc = c - > fc - > streams [ c - > fc - > nb_streams - 1 ] - > priv_data ;
sc = c - > fc - > streams [ c - > fc - > nb_streams - 1 ] - > priv_data ;
if ( atom . size < 24 | | sc - > mastering ) {
if ( atom . size < 24 ) {
av_log ( c - > fc , AV_LOG_ERROR , " Invalid Mastering Display Color Volume box \n " ) ;
av_log ( c - > fc , AV_LOG_ERROR , " Invalid Mastering Display Color Volume box \n " ) ;
return AVERROR_INVALIDDATA ;
return AVERROR_INVALIDDATA ;
}
}
if ( sc - > mastering ) {
av_log ( c - > fc , AV_LOG_WARNING , " Ignoring duplicate Mastering Display Color Volume \n " ) ;
return 0 ;
}
sc - > mastering = av_mastering_display_metadata_alloc ( ) ;
sc - > mastering = av_mastering_display_metadata_alloc ( ) ;
if ( ! sc - > mastering )
if ( ! sc - > mastering )
return AVERROR ( ENOMEM ) ;
return AVERROR ( ENOMEM ) ;