Re: [FFmpeg-devel] [PATCH] avformat/rtmpproto: Don't free AVOpt-strings manually, fix crash

2024-03-31 Thread Steven Liu
Liu Steven  于2024年3月31日周日 10:16写道:
>
>
>
> > On Mar 30, 2024, at 12:21, Andreas Rheinhardt 
> >  wrote:
> >
> > Andreas Rheinhardt:
> Hi Andreas,
>
> >> Besides being redundant, freeing manually is actually harmful here,
> >> as rtmp_close() may call gen_fcunpublish_stream() which dereferences
> >> rt->playpath.
> >>
> >> Reported-by: Armin Hasitzka 
> >> Signed-off-by: Andreas Rheinhardt 
> >> ---
> >> libavformat/rtmpproto.c | 3 ---
> >> 1 file changed, 3 deletions(-)
> >>
> >> diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
> >> index 4b01b67d28..b1d73b3d75 100644
> >> --- a/libavformat/rtmpproto.c
> >> +++ b/libavformat/rtmpproto.c
> >> @@ -2917,9 +2917,6 @@ reconnect:
> >> return 0;
> >>
> >> fail:
> >> -av_freep(&rt->playpath);
> >> -av_freep(&rt->tcurl);
> >> -av_freep(&rt->flashver);
> >> av_dict_free(opts);
> >> rtmp_close(s);
> >> return ret;
> >
> > I am pinging this and explicitly cc'ing Steven Liu, whose commit
> > 991cf95fdeebc3af added the av_freeps to be removed above. Steven, did
> > you just feel that there was missing freeing code for the buffers above
> > or was there an actually confirmed memleak (there shouldn't be)?
>
> Confirmed memleak, but it’s long time i cannot sure how to reproduce that, I 
> test rtmp those years use SRS.
May be the memleak was reported by fuzz program, the test case can
injection failed result make the workflow into the failed,
The gen_fcunpublish_stream should after av_malloc rt->playpath,
rt->tcurl, rt->flashver av_malloc, and there cloud get failed in the
gen_connect.

Steven
Thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/2] libavformat/hls.c: support in-stream ID3 metadata update.

2024-03-31 Thread Liu Steven



> On Mar 29, 2024, at 06:51, Romain Beauxis  wrote:
> 
> On Mon, Mar 25, 2024, 19:58 Romain Beauxis  wrote:
> 
>> This patch adds support for updating HLS metadata passed as ID3 frames.
>> 
>> This seems like a pretty straight-forward improvement. Updating the
>> metadaata of the first stream seems to be the mechanism is other places
>> in the code and works as expected.
>> 
> 
> 
> Hello!
> 
> Any interest in reviewing this?

Patchset looks good to me, looks better than before patch.
> 
> 
> ---
>> libavformat/hls.c | 54 ---
>> 1 file changed, 32 insertions(+), 22 deletions(-)
>> 
>> diff --git a/libavformat/hls.c b/libavformat/hls.c
>> index f6b44c2e35..ba6634d57a 100644
>> --- a/libavformat/hls.c
>> +++ b/libavformat/hls.c
>> @@ -93,6 +93,12 @@ enum PlaylistType {
>> PLS_TYPE_VOD
>> };
>> 
>> +#define ID3_PRIV_OWNER_TS "com.apple.streaming.transportStreamTimestamp"
>> +#define ID3_PRIV_OWNER_AUDIO_SETUP "com.apple.streaming.audioDescription"
>> +
>> +#define ID3v2_PRIV_OWNER_TS ID3v2_PRIV_METADATA_PREFIX ID3_PRIV_OWNER_TS
>> +#define ID3v2_PRIV_OWNER_AUDIO_SETUP ID3v2_PRIV_METADATA_PREFIX
>> ID3_PRIV_OWNER_AUDIO_SETUP
>> +
>> /*
>>  * Each playlist has its own demuxer. If it currently is active,
>>  * it has an open AVIOContext too, and potentially an AVPacket
>> @@ -150,9 +156,7 @@ struct playlist {
>> int64_t id3_offset; /* in stream original tb */
>> uint8_t* id3_buf; /* temp buffer for id3 parsing */
>> unsigned int id3_buf_size;
>> -AVDictionary *id3_initial; /* data from first id3 tag */
>> -int id3_found; /* ID3 tag found at some point */
>> -int id3_changed; /* ID3 tag data has changed at some point */
>> +AVDictionary *last_id3; /* data from the last id3 tag */
>> ID3v2ExtraMeta *id3_deferred_extra; /* stored here until subdemuxer
>> is opened */
>> 
>> HLSAudioSetupInfo audio_setup_info;
>> @@ -270,7 +274,7 @@ static void free_playlist_list(HLSContext *c)
>> av_freep(&pls->main_streams);
>> av_freep(&pls->renditions);
>> av_freep(&pls->id3_buf);
>> -av_dict_free(&pls->id3_initial);
>> +av_dict_free(&pls->last_id3);
>> ff_id3v2_free_extra_meta(&pls->id3_deferred_extra);
>> av_freep(&pls->init_sec_buf);
>> av_packet_free(&pls->pkt);
>> @@ -1083,15 +1087,13 @@ static void parse_id3(AVFormatContext *s,
>> AVIOContext *pb,
>>   AVDictionary **metadata, int64_t *dts,
>> HLSAudioSetupInfo *audio_setup_info,
>>   ID3v2ExtraMetaAPIC **apic, ID3v2ExtraMeta
>> **extra_meta)
>> {
>> -static const char id3_priv_owner_ts[] =
>> "com.apple.streaming.transportStreamTimestamp";
>> -static const char id3_priv_owner_audio_setup[] =
>> "com.apple.streaming.audioDescription";
>> ID3v2ExtraMeta *meta;
>> 
>> ff_id3v2_read_dict(pb, metadata, ID3v2_DEFAULT_MAGIC, extra_meta);
>> for (meta = *extra_meta; meta; meta = meta->next) {
>> if (!strcmp(meta->tag, "PRIV")) {
>> ID3v2ExtraMetaPRIV *priv = &meta->data.priv;
>> -if (priv->datasize == 8 && !av_strncasecmp(priv->owner,
>> id3_priv_owner_ts, 44)) {
>> +if (priv->datasize == 8 && !av_strncasecmp(priv->owner,
>> ID3_PRIV_OWNER_TS, strlen(ID3_PRIV_OWNER_TS))) {
>> /* 33-bit MPEG timestamp */
>> int64_t ts = AV_RB64(priv->data);
>> av_log(s, AV_LOG_DEBUG, "HLS ID3 audio timestamp
>> %"PRId64"\n", ts);
>> @@ -1099,7 +1101,9 @@ static void parse_id3(AVFormatContext *s,
>> AVIOContext *pb,
>> *dts = ts;
>> else
>> av_log(s, AV_LOG_ERROR, "Invalid HLS ID3 audio
>> timestamp %"PRId64"\n", ts);
>> -} else if (priv->datasize >= 8 &&
>> !av_strncasecmp(priv->owner, id3_priv_owner_audio_setup, 36)) {
>> +} else if (priv->datasize >= 8 &&
>> +   !av_strncasecmp(priv->owner,
>> ID3_PRIV_OWNER_AUDIO_SETUP, 36) &&
>> +   audio_setup_info) {
>> ff_hls_senc_read_audio_setup_info(audio_setup_info,
>> priv->data, priv->datasize);
>> }
>> } else if (!strcmp(meta->tag, "APIC") && apic)
>> @@ -1113,9 +1117,10 @@ static int id3_has_changed_values(struct playlist
>> *pls, AVDictionary *metadata,
>> {
>> const AVDictionaryEntry *entry = NULL;
>> const AVDictionaryEntry *oldentry;
>> +
>> /* check that no keys have changed values */
>> while ((entry = av_dict_iterate(metadata, entry))) {
>> -oldentry = av_dict_get(pls->id3_initial, entry->key, NULL,
>> AV_DICT_MATCH_CASE);
>> +oldentry = av_dict_get(pls->last_id3, entry->key, NULL,
>> AV_DICT_MATCH_CASE);
>> if (!oldentry || strcmp(oldentry->value, entry->value) != 0)
>> return 1;
>> }
>> @@ -1143,35 +1148,40 @@ static void handle_id3(AVIOContext *pb, struct
>> playlist *pls)
>> ID3v2ExtraMetaAPIC *apic = NULL;
>> ID3v2ExtraMeta 

[FFmpeg-devel] [PATCH] avformat/movenc: Check that cts fits in 32bit

2024-03-31 Thread Michael Niedermayer
Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, 
track->timescale, AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer 
---
 libavformat/movenc.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ae94d8d5959..5617a2620c5 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6194,6 +6194,12 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (ret < 0)
 return ret;
 
+if (pkt->pts != AV_NOPTS_VALUE &&
+(uint64_t)pkt->dts - pkt->pts != (int32_t)((uint64_t)pkt->dts - 
pkt->pts)) {
+av_log(s, AV_LOG_WARNING, "pts/dts pair unsupported\n");
+return AVERROR_PATCHWELCOME;
+}
+
 if (mov->flags & FF_MOV_FLAG_FRAGMENT || mov->mode == MODE_AVIF) {
 int ret;
 if (mov->moov_written || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] FFmpeg at NAB 2024

2024-03-31 Thread Derek Buitenhuis
On 11/1/2023 9:25 PM, Derek Buitenhuis wrote:
> This is certainly interesting considering we just had a giant thread about 
> not using
> or using SPI, with multiple people accused of having corporate interests.

Adding to the list of wtf NAB things:

https://twitter.com/JanetGrecoBP/status/1773342135514779700

I will be with #GPAC on the #FFMPEG stand #W4232 during #NABShow, from 
13-17th
April in Las Vegas. If you're interested in cutting-edge #openSource 
#ultramedia
video streaming & next-gen multimedia transcoding, packaging & delivery 
software,
do stop by or DM to meet! @wearegpac

(Janet does PR/markey and stuff for Motion Spell, GPAC's commercial arm.)

I am sure this email will continue the long trend of emails in this thread being
routed to Thilo's /dev/null.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] Fixes #10509

2024-03-31 Thread Marton Balint



On Fri, 29 Mar 2024, Poorva wrote:





On Tue, Mar 26, 2024 at 2:36 AM Poorva <2003gaikarpoo...@gmail.com> wrote:






Thank you for your feedback on the Git patch I submitted for review.
I have rectified the problem by adding the necessary changes .
The updated patch file is attached for your review.




I wanted to follow up on the patch titled
"v3-0001-avfilter-f_select.c - Add Support for IW and IH" that I
submitted earlier and provide an update based on the feedback
received.

In response to your suggestion about the switch block, I have
integrated the changes into the existing switch block for
AVMEDIA_TYPE_VIDEO. Additionally, I have removed an unnecessary new
line that was added at the end of the file.

Despite these modifications, I have not received any further feedback
or comments on the patch. Therefore, I kindly request the community to
review the updated patch attached to this email.


[..]


@@ -371,6 +383,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 break;
 }

+
 select->select = res = av_expr_eval(select->expr, select->var_values, 
NULL);
 av_log(inlink->dst, AV_LOG_DEBUG,
"n:%f pts:%f t:%f key:%d",
@@ -545,4 +558,4 @@ const AVFilter ff_vf_select = {
 FILTER_QUERY_FUNC(query_formats),
 .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | 
AVFILTER_FLAG_METADATA_ONLY,
 };
-#endif /* CONFIG_SELECT_FILTER */
+#endif /* CONFIG_SELECT_FILTER */
\ No newline at end of file
--
2.43.0.windows.1



These two whitespace changes are still unnecessary. Please check your 
patch before sending.


Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v10 2/5] avformat/rcwtdec: add RCWT Closed Captions demuxer

2024-03-31 Thread Michael Niedermayer
On Sat, Mar 30, 2024 at 03:55:13PM +0100, Stefano Sabatini wrote:
> On date Saturday 2024-03-30 01:23:53 +0100, Michael Niedermayer wrote:
> > On Thu, Mar 28, 2024 at 03:11:29PM -0500, Marth64 wrote:
> > [...]
> > 
> > > +static int rcwt_probe(const AVProbeData *p)
> > > +{
> > > +return p->buf_size > RCWT_HEADER_SIZE   &&
> > > +   AV_RB16(p->buf) == 0x&&
> > > +   AV_RB8(p->buf + 2) == 0xED   &&
> > > +   AV_RB16(p->buf + 6) == 0x0001? 50 : 0;
> > > +}
> > > +
> > > +const FFInputFormat ff_rcwt_demuxer = {
> > > +.p.name = "rcwt",
> > > +.p.long_name= NULL_IF_CONFIG_SMALL("RCWT (Raw Captions With 
> > > Time)"),
> > > +.p.extensions   = "bin",
> > 
> 
> > this causes a mp3 i have to be misdetected
> > ~/videos/sbQ9.bin
> > (this is a actual file i had not a file crafted for this)
> > 
> > i think the entry for extensions should be removed (which fixes this)
> > having a ".bin" is not a strong indication that its rcwt
> 
> Is this blocking or can it be addressed later? Also, if this needs to

droping the "bin" from the demuxer should be trivial to do, the extension
is IIRC used mainly for probing and its wrong for probing to associate bin with
any specific format.


> be modified the muxer should be as well.

maybe, yes

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avformat/movenc: Check that cts fits in 32bit

2024-03-31 Thread James Almer

On 3/31/2024 8:40 AM, Michael Niedermayer wrote:

Fixes: Assertion av_rescale_rnd(start_dts, mov->movie_timescale, track->timescale, 
AV_ROUND_DOWN) <= 0 failed at libavformat/movenc.c:3694
Fixes: poc2

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer 
---
  libavformat/movenc.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ae94d8d5959..5617a2620c5 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6194,6 +6194,12 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
  if (ret < 0)
  return ret;
  
+if (pkt->pts != AV_NOPTS_VALUE &&

+(uint64_t)pkt->dts - pkt->pts != (int32_t)((uint64_t)pkt->dts - 
pkt->pts)) {
+av_log(s, AV_LOG_WARNING, "pts/dts pair unsupported\n");
+return AVERROR_PATCHWELCOME;
+}


Any such check should happen in check_pkt(), called directly above. And 
afaict there's no reason to not support 64bit cts. Even in 
mov_write_edts_tag() we check for it and write a version 1 of the box 
that supports 64bit values.


Maybe the problem is that MOVIentry.cts is an int, when it should be an 
int64_t like start_cts? Can you test the following?



diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 08d580594d..e736c92750 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -49,11 +49,11 @@ typedef struct MOVIentry {
 uint64_t pos;
 int64_t  dts;
 int64_t  pts;
+int64_t  cts;
 unsigned int size;
 unsigned int samples_in_chunk;
 unsigned int chunkNum;  ///< Chunk number if the current entry 
is a chunk start otherwise 0
 unsigned int entries;
-int  cts;
 #define MOV_SYNC_SAMPLE 0x0001
 #define MOV_PARTIAL_SYNC_SAMPLE 0x0002
 #define MOV_DISPOSABLE_SAMPLE   0x0004

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/2] libavformat/hls.c: support in-stream ID3 metadata update.

2024-03-31 Thread Romain Beauxis
On Sun, Mar 31, 2024, 05:52 Liu Steven  wrote:

>
>
> > On Mar 29, 2024, at 06:51, Romain Beauxis  wrote:
> >
> > On Mon, Mar 25, 2024, 19:58 Romain Beauxis  wrote:
> >
> >> This patch adds support for updating HLS metadata passed as ID3 frames.
> >>
> >> This seems like a pretty straight-forward improvement. Updating the
> >> metadaata of the first stream seems to be the mechanism is other places
> >> in the code and works as expected.
> >>
> >
> >
> > Hello!
> >
> > Any interest in reviewing this?
>
> Patchset looks good to me, looks better than before patch.
>

Great! Happy to provide the fate samples too.


> ---
> >> libavformat/hls.c | 54 ---
> >> 1 file changed, 32 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/libavformat/hls.c b/libavformat/hls.c
> >> index f6b44c2e35..ba6634d57a 100644
> >> --- a/libavformat/hls.c
> >> +++ b/libavformat/hls.c
> >> @@ -93,6 +93,12 @@ enum PlaylistType {
> >> PLS_TYPE_VOD
> >> };
> >>
> >> +#define ID3_PRIV_OWNER_TS
> "com.apple.streaming.transportStreamTimestamp"
> >> +#define ID3_PRIV_OWNER_AUDIO_SETUP
> "com.apple.streaming.audioDescription"
> >> +
> >> +#define ID3v2_PRIV_OWNER_TS ID3v2_PRIV_METADATA_PREFIX
> ID3_PRIV_OWNER_TS
> >> +#define ID3v2_PRIV_OWNER_AUDIO_SETUP ID3v2_PRIV_METADATA_PREFIX
> >> ID3_PRIV_OWNER_AUDIO_SETUP
> >> +
> >> /*
> >>  * Each playlist has its own demuxer. If it currently is active,
> >>  * it has an open AVIOContext too, and potentially an AVPacket
> >> @@ -150,9 +156,7 @@ struct playlist {
> >> int64_t id3_offset; /* in stream original tb */
> >> uint8_t* id3_buf; /* temp buffer for id3 parsing */
> >> unsigned int id3_buf_size;
> >> -AVDictionary *id3_initial; /* data from first id3 tag */
> >> -int id3_found; /* ID3 tag found at some point */
> >> -int id3_changed; /* ID3 tag data has changed at some point */
> >> +AVDictionary *last_id3; /* data from the last id3 tag */
> >> ID3v2ExtraMeta *id3_deferred_extra; /* stored here until subdemuxer
> >> is opened */
> >>
> >> HLSAudioSetupInfo audio_setup_info;
> >> @@ -270,7 +274,7 @@ static void free_playlist_list(HLSContext *c)
> >> av_freep(&pls->main_streams);
> >> av_freep(&pls->renditions);
> >> av_freep(&pls->id3_buf);
> >> -av_dict_free(&pls->id3_initial);
> >> +av_dict_free(&pls->last_id3);
> >> ff_id3v2_free_extra_meta(&pls->id3_deferred_extra);
> >> av_freep(&pls->init_sec_buf);
> >> av_packet_free(&pls->pkt);
> >> @@ -1083,15 +1087,13 @@ static void parse_id3(AVFormatContext *s,
> >> AVIOContext *pb,
> >>   AVDictionary **metadata, int64_t *dts,
> >> HLSAudioSetupInfo *audio_setup_info,
> >>   ID3v2ExtraMetaAPIC **apic, ID3v2ExtraMeta
> >> **extra_meta)
> >> {
> >> -static const char id3_priv_owner_ts[] =
> >> "com.apple.streaming.transportStreamTimestamp";
> >> -static const char id3_priv_owner_audio_setup[] =
> >> "com.apple.streaming.audioDescription";
> >> ID3v2ExtraMeta *meta;
> >>
> >> ff_id3v2_read_dict(pb, metadata, ID3v2_DEFAULT_MAGIC, extra_meta);
> >> for (meta = *extra_meta; meta; meta = meta->next) {
> >> if (!strcmp(meta->tag, "PRIV")) {
> >> ID3v2ExtraMetaPRIV *priv = &meta->data.priv;
> >> -if (priv->datasize == 8 && !av_strncasecmp(priv->owner,
> >> id3_priv_owner_ts, 44)) {
> >> +if (priv->datasize == 8 && !av_strncasecmp(priv->owner,
> >> ID3_PRIV_OWNER_TS, strlen(ID3_PRIV_OWNER_TS))) {
> >> /* 33-bit MPEG timestamp */
> >> int64_t ts = AV_RB64(priv->data);
> >> av_log(s, AV_LOG_DEBUG, "HLS ID3 audio timestamp
> >> %"PRId64"\n", ts);
> >> @@ -1099,7 +1101,9 @@ static void parse_id3(AVFormatContext *s,
> >> AVIOContext *pb,
> >> *dts = ts;
> >> else
> >> av_log(s, AV_LOG_ERROR, "Invalid HLS ID3 audio
> >> timestamp %"PRId64"\n", ts);
> >> -} else if (priv->datasize >= 8 &&
> >> !av_strncasecmp(priv->owner, id3_priv_owner_audio_setup, 36)) {
> >> +} else if (priv->datasize >= 8 &&
> >> +   !av_strncasecmp(priv->owner,
> >> ID3_PRIV_OWNER_AUDIO_SETUP, 36) &&
> >> +   audio_setup_info) {
> >> ff_hls_senc_read_audio_setup_info(audio_setup_info,
> >> priv->data, priv->datasize);
> >> }
> >> } else if (!strcmp(meta->tag, "APIC") && apic)
> >> @@ -1113,9 +1117,10 @@ static int id3_has_changed_values(struct playlist
> >> *pls, AVDictionary *metadata,
> >> {
> >> const AVDictionaryEntry *entry = NULL;
> >> const AVDictionaryEntry *oldentry;
> >> +
> >> /* check that no keys have changed values */
> >> while ((entry = av_dict_iterate(metadata, entry))) {
> >> -oldentry = av_dict_get(pls->id3_initial, entry->key, NULL,
> >> AV_DICT_MATCH_CASE);
> >> +oldentry = av_dict_get(pls->la

[FFmpeg-devel] [PATCH] avfilter/buffersrc: never override channel count in av_buffersrc_add_frame_flags

2024-03-31 Thread Marton Balint
Overriding unknown layouts with the negotiated layout is OK, but the number of
channels should match with what was negotiated.

Signed-off-by: Marton Balint 
---
 libavfilter/buffersrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 130751775a..3ea3ca92c9 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -215,7 +215,7 @@ int attribute_align_arg 
av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFra
 break;
 case AVMEDIA_TYPE_AUDIO:
 /* For layouts unknown on input but known on link after 
negotiation. */
-if (frame->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) {
+if (frame->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC && 
frame->ch_layout.nb_channels == s->ch_layout.nb_channels) {
 ret = av_channel_layout_copy(&frame->ch_layout, &s->ch_layout);
 if (ret < 0)
 return ret;
-- 
2.35.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH] avformat/hlsenc: use a slash separator even in win32

2024-03-31 Thread Marton Balint
We don't know if the protocol used is referring to a local file or a remote
resource, so it is better to simply use slash as separator which works all the
time. (well, except in very special cases when the user specified a \\?\ path)

Fixes ticket #9780.

Signed-off-by: Marton Balint 
---
 libavformat/hlsenc.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index ac8bb189f0..bde7230036 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -570,12 +570,6 @@ static void reflush_dynbuf(VariantStream *vs, int 
*range_length)
 avio_write(vs->out, vs->temp_buffer, *range_length);
 }
 
-#if HAVE_DOS_PATHS
-#define SEPARATOR '\\'
-#else
-#define SEPARATOR '/'
-#endif
-
 static int hls_delete_file(HLSContext *hls, AVFormatContext *avf,
char *path, const char *proto)
 {
@@ -668,7 +662,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 av_log(hls, AV_LOG_DEBUG, "deleting old segment %s\n",
segment->filename);
 if (!hls->use_localtime_mkdir) // segment->filename contains basename 
only
-av_bprintf(&path, "%s%c", dirname, SEPARATOR);
+av_bprintf(&path, "%s/", dirname);
 av_bprintf(&path, "%s", segment->filename);
 
 if (!av_bprint_is_complete(&path)) {
@@ -685,8 +679,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 vtt_dirname = av_dirname(vtt_dirname_r);
 
 av_bprint_clear(&path);
-av_bprintf(&path, "%s%c%s", vtt_dirname, SEPARATOR,
- segment->sub_filename);
+av_bprintf(&path, "%s/%s", vtt_dirname, segment->sub_filename);
 av_freep(&vtt_dirname_r);
 
 if (!av_bprint_is_complete(&path)) {
-- 
2.35.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 4/4] avformat/iamf: Check language_label

2024-03-31 Thread Michael Niedermayer
On Thu, Mar 21, 2024 at 04:55:46AM +0100, Michael Niedermayer wrote:
> On Wed, Mar 20, 2024 at 11:17:09PM -0300, James Almer wrote:
> > On 3/20/2024 10:15 PM, Michael Niedermayer wrote:
> > > Fixes: null pointer dereference
> > > Fixes: 
> > > 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6011025237278720
> > > 
> > > Found-by: continuous fuzzing process 
> > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >   libavformat/iamf.c | 7 ---
> > >   1 file changed, 4 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/libavformat/iamf.c b/libavformat/iamf.c
> > > index 5de70dc082..f2c22ce3aa 100644
> > > --- a/libavformat/iamf.c
> > > +++ b/libavformat/iamf.c
> > > @@ -89,9 +89,10 @@ void ff_iamf_free_mix_presentation(IAMFMixPresentation 
> > > **pmix_presentation)
> > >   if (!mix_presentation)
> > >   return;
> > > -for (int i = 0; i < mix_presentation->count_label; i++)
> > > -av_free(mix_presentation->language_label[i]);
> > > -av_free(mix_presentation->language_label);
> > > +if (mix_presentation->language_label)
> > 
> > If count_label is not 0, then language_label should be allocated.
> > 
> > > +for (int i = 0; i < mix_presentation->count_label; i++)
> > > +av_free(mix_presentation->language_label[i]);
> > > +av_freep(&mix_presentation->language_label);
> > >   av_iamf_mix_presentation_free(&mix_presentation->mix);
> > >   av_freep(pmix_presentation);
> > >   }
> > 
> > Can you test the following?
> > 
> > > diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
> > > index cb49cf0a57..e29c2c6b6c 100644
> > > --- a/libavformat/iamf_parse.c
> > > +++ b/libavformat/iamf_parse.c
> > > @@ -822,6 +822,7 @@ static int mix_presentation_obu(void *s, IAMFContext 
> > > *c, AVIOContext *pb, int le
> > >  mix_presentation->language_label = 
> > > av_calloc(mix_presentation->count_label,
> > >   
> > > sizeof(*mix_presentation->language_label));
> > >  if (!mix_presentation->language_label) {
> > > +mix_presentation->count_label = 0;
> > >  ret = AVERROR(ENOMEM);
> > >  goto fail;
> > >  }
> 
> that works too, i think pointers should be set to NULL on deallocation though

i will apply this alternative

txh

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 1/3] avcodec/exr: Check for remaining bits in huf_unpack_enc_table()

2024-03-31 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
67645/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6308760977997824

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/exr.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 0f1f683e7e7..09f2fca109c 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -335,7 +335,10 @@ static int huf_unpack_enc_table(GetByteContext *gb,
 return ret;
 
 for (; im <= iM; im++) {
-uint64_t l = freq[im] = get_bits(&gbit, 6);
+uint64_t l;
+if (get_bits_left(&gbit) < 6)
+return AVERROR_INVALIDDATA;
+l = freq[im] = get_bits(&gbit, 6);
 
 if (l == LONG_ZEROCODE_RUN) {
 int zerun = get_bits(&gbit, 8) + SHORTEST_LONG_RUN;
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 2/3] avcodec/exr: Dont use 64bits to hold 6bits

2024-03-31 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/exr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 09f2fca109c..8bd39f78a45 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -335,7 +335,7 @@ static int huf_unpack_enc_table(GetByteContext *gb,
 return ret;
 
 for (; im <= iM; im++) {
-uint64_t l;
+int l;
 if (get_bits_left(&gbit) < 6)
 return AVERROR_INVALIDDATA;
 l = freq[im] = get_bits(&gbit, 6);
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH 3/3] avcodec/hevcdec: Fix null dereference in hevc_frame_end()

2024-03-31 Thread Michael Niedermayer
Fixes: member access within null pointer of type 'const AVFilmGrainParams' (aka 
'const struct AVFilmGrainParams')
Fixes: 
67701/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6595117570916352

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/hevcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 752459af2d3..2514d522ba5 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2945,6 +2945,8 @@ static int hevc_frame_end(HEVCContext *s)
 if (out->needs_fg) {
 av_assert0(out->frame_grain->buf[0]);
 fgp = av_film_grain_params_select(out->frame);
+if (!fgp)
+return 0;
 switch (fgp->type) {
 case AV_FILM_GRAIN_PARAMS_NONE:
 av_assert0(0);
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v1] lavc/vaapi_encode: Add VAAPI version check for BLBRC

2024-03-31 Thread Xiang, Haihao
On Vr, 2024-03-29 at 09:10 +0800, fei.w.wang-at-intel@ffmpeg.org wrote:
> From: Fei Wang 
> 
> Fix build fail when VAAPI version less than 0.39.2.
> 
> Signed-off-by: Fei Wang 
> ---
>  libavcodec/vaapi_encode.c | 20 +---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
> index 940f0678a5..c4b5411e68 100644
> --- a/libavcodec/vaapi_encode.c
> +++ b/libavcodec/vaapi_encode.c
> @@ -1805,9 +1805,17 @@ static av_cold int
> vaapi_encode_init_rate_control(AVCodecContext *avctx)
>  int i, first = 1, res;
>  
>  supported_va_rc_modes = rc_attr.value;
> -    if (ctx->blbrc && !(supported_va_rc_modes & VA_RC_MB)) {
> +    if (ctx->blbrc) {
> +#if VA_CHECK_VERSION(0, 39, 2)
> +    if (!(supported_va_rc_modes & VA_RC_MB)) {
> +    ctx->blbrc = 0;
> +    av_log(avctx, AV_LOG_WARNING, "Driver does not support
> BLBRC.\n");
> +    }
> +#else
>  ctx->blbrc = 0;
> -    av_log(avctx, AV_LOG_WARNING, "Driver does not support
> BLBRC.\n");
> +    av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI
> 0.39.2 "
> +   "or above, which can support BLBRC.\n");
> +#endif
>  }
>  
>  for (i = 0; i < FF_ARRAY_ELEMS(vaapi_encode_rc_modes); i++) {
> @@ -2032,7 +2040,11 @@ rc_mode_found:
>  ctx->config_attributes[ctx->nb_config_attributes++] =
>  (VAConfigAttrib) {
>  .type  = VAConfigAttribRateControl,
> +#if VA_CHECK_VERSION(0, 39, 2)
>  .value = ctx->blbrc ? ctx->va_rc_mode | VA_RC_MB : ctx-
> >va_rc_mode,
> +#else
> +    .value = ctx->va_rc_mode,
> +#endif
>  };
>  }
>  
> @@ -2061,10 +2073,12 @@ rc_mode_found:
>  #if VA_CHECK_VERSION(1, 1, 0)
>  .ICQ_quality_factor = av_clip(rc_quality, 1, 51),
>  .max_qp = (avctx->qmax > 0 ? avctx->qmax : 0),
> -    .rc_flags.bits.mb_rate_control = ctx->blbrc ? 1 : 2,
>  #endif
>  #if VA_CHECK_VERSION(1, 3, 0)
>  .quality_factor = rc_quality,
> +#endif
> +#if VA_CHECK_VERSION(0, 39, 2)
> +    .rc_flags.bits.mb_rate_control = ctx->blbrc ? 1 : 2,
>  #endif
>  };
>  vaapi_encode_add_global_param(avctx,

LGTM, will apply,

- Haihao


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] lavc/vaapi_encode: convert from lambda to qp

2024-03-31 Thread Xiang, Haihao
On Do, 2024-03-28 at 14:55 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> When AV_CODEC_FLAG_QSCALE is set, the value of avctx->global_quality is
> lambda.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavcodec/vaapi_encode.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
> index 940f0678a5..8b53095d61 100644
> --- a/libavcodec/vaapi_encode.c
> +++ b/libavcodec/vaapi_encode.c
> @@ -1961,7 +1961,10 @@ rc_mode_found:
>  if (ctx->explicit_qp) {
>  rc_quality = ctx->explicit_qp;
>  } else if (avctx->global_quality > 0) {
> -    rc_quality = avctx->global_quality;
> +    if (avctx->flags & AV_CODEC_FLAG_QSCALE)
> +    rc_quality = avctx->global_quality / FF_QP2LAMBDA;
> +    else
> +    rc_quality = avctx->global_quality;
>  } else {
>  rc_quality = ctx->codec->default_quality;
>  av_log(avctx, AV_LOG_WARNING, "No quality level set; "

Will apply,

- Haihao


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] lavc/vaapi_hevc: Add support for Main Intra & Main 10 Intra

2024-03-31 Thread Xiang, Haihao
On Do, 2024-03-28 at 10:07 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> Both Main Intra and Main 10 Intra are Rext, we may use Main and Main 10
> instead for decoding. This patch fixes the error below:
> 
> [hevc @ 0x55a771b80a00] No support for codec hevc profile 4.
> [hevc @ 0x55a771b80a00] Failed setup for format vaapi: hwaccel
> initialisation returned error.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavcodec/vaapi_hevc.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
> index 3bdd2dd1b8..83b94d1a55 100644
> --- a/libavcodec/vaapi_hevc.c
> +++ b/libavcodec/vaapi_hevc.c
> @@ -612,6 +612,13 @@ VAProfile
> ff_vaapi_parse_hevc_rext_scc_profile(AVCodecContext *avctx)
>  av_log(avctx, AV_LOG_VERBOSE, "HEVC profile %s is found.\n", profile-
> >name);
>  }
>  
> +#if VA_CHECK_VERSION(0, 37, 0)
> +    if (!strcmp(profile->name, "Main Intra"))
> +    return VAProfileHEVCMain;
> +    else if (!strcmp(profile->name, "Main 10 Intra"))
> +    return VAProfileHEVCMain10;
> +#endif
> +
>  #if VA_CHECK_VERSION(1, 2, 0)
>  if (!strcmp(profile->name, "Main 12") ||
>  !strcmp(profile->name, "Main 12 Intra"))

Will apply,

- Haihao


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v3 2/2] lavc/vaapi_encode_h265: Set general_*_constriaint flags with profile

2024-03-31 Thread Wang, Fei W
On Wed, 2024-03-20 at 16:44 +0800, Fei Wang wrote:
> On Mon, 2024-03-18 at 21:22 +, Mark Thompson wrote:
> > On 18/03/2024 04:21, fei.w.wang-at-intel@ffmpeg.org wrote:
> > > From: Fei Wang 
> > > 
> > > According to Table A.2 in spec.
> > > 
> > > Signed-off-by: Fei Wang 
> > > ---
> > >   libavcodec/vaapi_encode_h265.c | 176 +++---
> > > --
> > > -
> > >   1 file changed, 123 insertions(+), 53 deletions(-)
> > > 
> > > diff --git a/libavcodec/vaapi_encode_h265.c
> > > b/libavcodec/vaapi_encode_h265.c
> > > index 43755e2188..5ed317ce11 100644
> > > --- a/libavcodec/vaapi_encode_h265.c
> > > +++ b/libavcodec/vaapi_encode_h265.c
> > > @@ -258,6 +258,124 @@ fail:
> > >   return err;
> > >   }
> > >   
> > > +static int vaapi_encode_h265_init_ptl(AVCodecContext *avctx)
> > > +{
> > > +VAAPIEncodeContext  *ctx = avctx->priv_data;
> > > +VAAPIEncodeH265Context *priv = avctx->priv_data;
> > > +H265RawVPS  *vps = &priv->raw_vps;
> > > +H265RawProfileTierLevel *ptl = &vps->profile_tier_level;
> > > +
> > > +ptl->general_profile_space = 0;
> > > +ptl->general_profile_idc   = avctx->profile;
> > > +ptl->general_tier_flag = priv->tier;
> > > +
> > > +ptl->general_profile_compatibility_flag[ptl-
> > > > general_profile_idc] = 1;
> > > +
> > > +if (ptl->general_profile_compatibility_flag[1])
> > > +ptl->general_profile_compatibility_flag[2] = 1;
> > > +if (ptl->general_profile_compatibility_flag[3]) {
> > > +ptl->general_profile_compatibility_flag[1] = 1;
> > > +ptl->general_profile_compatibility_flag[2] = 1;
> > > +}
> > > +
> > > +ptl->general_progressive_source_flag= 1;
> > > +ptl->general_interlaced_source_flag = 0;
> > > +ptl->general_non_packed_constraint_flag = 1;
> > > +ptl->general_frame_only_constraint_flag = 1;
> > > +
> > > +if (avctx->profile >= 4) {
> > > +ptl->general_intra_constraint_flag= ctx-
> > > > gop_size == 1;
> > > +ptl->general_one_picture_only_constraint_flag = 0;
> > > +ptl->general_lower_bit_rate_constraint_flag   = 1;
> > > +ptl->general_max_14bit_constraint_flag= 0;
> > > +
> > > +switch (ctx->va_profile) {
> > > +#if VA_CHECK_VERSION(1, 2, 0)
> > > +case VAProfileHEVCMain12:
> > > +// Main 12
> > > +ptl->general_max_12bit_constraint_flag  = 1;
> > > +ptl->general_max_10bit_constraint_flag  = 0;
> > > +ptl->general_max_8bit_constraint_flag   = 0;
> > > +ptl->general_max_422chroma_constraint_flag  = 1;
> > > +ptl->general_max_420chroma_constraint_flag  = 1;
> > > +ptl->general_max_monochrome_constraint_flag = 0;
> > > +break;
> > > +case VAProfileHEVCMain422_10:
> > > +// Main 4:2:2 10
> > > +ptl->general_max_12bit_constraint_flag  = 1;
> > > +ptl->general_max_10bit_constraint_flag  = 1;
> > > +ptl->general_max_8bit_constraint_flag   = 0;
> > > +ptl->general_max_422chroma_constraint_flag  = 1;
> > > +ptl->general_max_420chroma_constraint_flag  = 0;
> > > +ptl->general_max_monochrome_constraint_flag = 0;
> > > +break;
> > > +case VAProfileHEVCMain422_12:
> > > +// Main 4:2:2 12
> > > +ptl->general_max_12bit_constraint_flag  = 1;
> > > +ptl->general_max_10bit_constraint_flag  = 0;
> > > +ptl->general_max_8bit_constraint_flag   = 0;
> > > +ptl->general_max_422chroma_constraint_flag  = 1;
> > > +ptl->general_max_420chroma_constraint_flag  = 0;
> > > +ptl->general_max_monochrome_constraint_flag = 0;
> > > +break;
> > > +case VAProfileHEVCMain444:
> > > +// Main 4:4:4
> > > +ptl->general_max_12bit_constraint_flag  = 1;
> > > +ptl->general_max_10bit_constraint_flag  = 1;
> > > +ptl->general_max_8bit_constraint_flag   = 1;
> > > +ptl->general_max_422chroma_constraint_flag  = 0;
> > > +ptl->general_max_420chroma_constraint_flag  = 0;
> > > +ptl->general_max_monochrome_constraint_flag = 0;
> > > +break;
> > > +case VAProfileHEVCMain444_10:
> > > +// Main 4:4:4 10
> > > +ptl->general_max_12bit_constraint_flag  = 1;
> > > +ptl->general_max_10bit_constraint_flag  = 1;
> > > +ptl->general_max_8bit_constraint_flag   = 0;
> > > +ptl->general_max_422chroma_constraint_flag  = 0;
> > > +ptl->general_max_420chroma_constraint_flag  = 0;
> > > +ptl->general_max_monochrome_constraint_flag = 0;
> > > +break;
> > > +case VAProfileHEVCMain444_12:
> > > +// Main 4:4:4 12
> > > +ptl->general_max_12bit_constrain