[FFmpeg-devel] [PATCH] hevc_mp4toannexb: Do not duplicate parameter sets

2019-07-20 Thread Andriy Gelman
From: Andriy Gelman 

Fixes #7799

Currently, the mp4toannexb filter always inserts extradata at the start
of each IRAP unit. This can lead to duplication of parameter sets if the
demuxed packet from mdat atom already contains a version of the
parameters.

As in ticket #7799 this can also lead to decoding errors when the
parameter sets of the IRAP frames are different from the ones stored in
extradata.

This commit avoids duplicating the parameter sets if they are already
present in the demuxed packet.

This commit also makes an update to the hevc-bsf-mp4toannexb fate
test since the result before this patch contained duplicate vps/sps/pps
nal units.
---
 libavcodec/hevc_mp4toannexb_bsf.c | 9 -
 tests/fate/hevc.mak   | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc_mp4toannexb_bsf.c 
b/libavcodec/hevc_mp4toannexb_bsf.c
index 09bce5b34c..5c27306b09 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -123,6 +123,7 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, 
AVPacket *out)
 
 int got_irap = 0;
 int i, ret = 0;
+int vps_detected, sps_detected, pps_detected = 0;
 
 ret = ff_bsf_get_packet(ctx, &in);
 if (ret < 0)
@@ -146,9 +147,15 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, 
AVPacket *out)
 
 nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f;
 
+switch (nalu_type) {
+  case HEVC_NAL_VPS: vps_detected = 1; break;
+  case HEVC_NAL_SPS: sps_detected = 1; break;
+  case HEVC_NAL_PPS: pps_detected = 1; break;
+}
+
 /* prepend extradata to IRAP frames */
 is_irap   = nalu_type >= 16 && nalu_type <= 23;
-add_extradata = is_irap && !got_irap;
+add_extradata = is_irap && !got_irap && !(vps_detected && sps_detected 
&& pps_detected);
 extra_size= add_extradata * ctx->par_out->extradata_size;
 got_irap |= is_irap;
 
diff --git a/tests/fate/hevc.mak b/tests/fate/hevc.mak
index 559c3898bc..4f812b0834 100644
--- a/tests/fate/hevc.mak
+++ b/tests/fate/hevc.mak
@@ -238,7 +238,7 @@ FATE_HEVC-$(call ALLYES, HEVC_DEMUXER MOV_DEMUXER 
HEVC_MP4TOANNEXB_BSF MOV_MUXER
 fate-hevc-bsf-mp4toannexb: tests/data/hevc-mp4.mov
 fate-hevc-bsf-mp4toannexb: CMD = md5 -i $(TARGET_PATH)/tests/data/hevc-mp4.mov 
-c:v copy -fflags +bitexact -f hevc
 fate-hevc-bsf-mp4toannexb: CMP = oneline
-fate-hevc-bsf-mp4toannexb: REF = 1873662a3af1848c37e4eb25722c8df9
+fate-hevc-bsf-mp4toannexb: REF = 3c9d998a3aa2b9e0fb1c1f434952bf8b
 
 fate-hevc-skiploopfilter: CMD = framemd5 -skip_loop_filter nokey -i 
$(TARGET_SAMPLES)/hevc-conformance/SAO_D_Samsung_5.bit -sws_flags bitexact
 FATE_HEVC += fate-hevc-skiploopfilter
-- 
2.22.0

___
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] vp3data, mpc8huff: Make some arrays unsigned to prevent overflow

2019-07-20 Thread Peter Ross
On Sat, Jul 20, 2019 at 03:51:25PM +0200, Andreas Rheinhardt wrote:
> Some of the VP3 arrays (namely vp31_intra_y_dequant, vp31_intra_c_dequant
> and vp31_inter_dequant) are currently declared as array of (const) int8_t
> despite them being only used to directly initialize an array of uint8_t.
> vp31_inter_dequant even contains the value 128 which is not
> representible in int8_t and might generate overflow warnings by
> compilers.
> 
> Similarly, mpc8_q4_syms is an array of int8_t that is initialized using
> values not in the range of an int8_t and that is only accessed via
> a pointer to uint8_t in ff_init_vlc_sparse. The latter applies to all
> the other *_bits and *_syms tables in mpc8huff.h, so make them all
> unsigned.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/mpc8huff.h | 34 +-
>  libavcodec/vp3data.h  |  6 +++---
>  2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/libavcodec/mpc8huff.h b/libavcodec/mpc8huff.h
> index 8491037aa4..0566c910ca 100644
> --- a/libavcodec/mpc8huff.h
> +++ b/libavcodec/mpc8huff.h
> @@ -34,7 +34,7 @@ static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = {
>   0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03,
>   0x01,
>  };
> -static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
> +static const uint8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
>1,  3,  5,  6,  7,  8,  8,  9,
>   10, 11, 12, 12, 12, 13, 12, 12,
>   12, 12, 12, 13, 12, 12, 12, 11,
> @@ -48,7 +48,7 @@ static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
>  static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = {
>   0x00, 0x01, 0x01, 0x01,
>  };
> -static const int8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
> +static const uint8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
>3,  3,  1,  2,
>  };
>  
> @@ -60,7 +60,7 @@ static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = {
>   0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03,
>  
>  };
> -static const int8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
> +static const uint8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
>6,  7,  6,  6,  7,  5,  5,  5,
>6,  5,  2,  3,  6,  5,  3,  2,
>  
> @@ -79,7 +79,7 @@ static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = {
>   0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03,
>   0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
>  };
> -static const int8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
> +static const uint8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
>   12, 12, 12, 11, 11, 11, 10, 10,
>   10, 10, 10,  9,  9,  9,  9,  8,
>8,  8,  8,  7,  7,  7,  7,  6,
> @@ -105,7 +105,7 @@ static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = {
>   0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05,
>   0x0D,
>  };
> -static const int8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
> +static const uint8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
>   15, 14, 14, 13, 13, 13, 12, 12,
>   12, 12, 11, 11, 11, 11, 10, 10,
>   10, 10,  9,  9,  9,  8,  8,  7,
> @@ -132,7 +132,7 @@ static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = {
>  0x03,
>}
>  };
> -static const int8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
> +static const uint8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
>{
>   1,  2,  4,  5,  6,  7,  9, 10,
>  11, 12, 13, 14, 15, 16, 16,  8,
> @@ -153,7 +153,7 @@ static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = {
>   0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
>   0x01, 0x00, 0x01,
>  };
> -static const int8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
> +static const uint8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
>6,  4,  4,  3,  3,  3,  3,  3,
>4,  4,  4,  5,  7,  8,  9, 10,
>   11, 12, 12,
> @@ -196,7 +196,7 @@ static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = {
>   0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
>   0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01,
>  };
> -static const int8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
> +static const uint8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
>   10, 10, 10, 10, 10,  9,  9,  9,
>9,  9,  9,  9,  9,  9,  9,  9,
>9,  9,  9,  8,  8,  9,  9,  9,
> @@ -272,7 +272,7 @@ static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = {
>   0x03, 0x1C, 0x17, 0x1D, 0x05,
>  }
>  };
> -static const int8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
> +static const uint8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
>  {
>   12, 11, 10, 11, 13, 11,  9,  8,
>9, 11, 11,  8,  7,  8, 11, 11,
> @@ -324,7 +324,7 @@ static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = {
>   0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
>   0x00,
>  };
> -static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
> +static const uint8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
>3,  4,  4,  4,  4,  4,  4,  5,
>5,  5,  5,  5,  5,  6,  6,  6,
>6,  6,  6,  6,  6,  6,  6,  6,
> @@ -333,7 +333,7 @@ static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
>8,  8,  8,  8,  8,  9,  9,  9,
>9,
>  };
> -static const int8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
> +static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
> 48,65,64,49,63,32,47,80,
> 79,50,62, 

Re: [FFmpeg-devel] [PATCH] avformat/aacdec: resync to the next aac sample on invalid data instead of aborting

2019-07-20 Thread James Almer
On 7/20/2019 12:41 PM, James Almer wrote:
> On 7/20/2019 12:33 PM, Carl Eugen Hoyos wrote:
>>
>>
>>
>>> Am 20.07.2019 um 15:13 schrieb James Almer :
>>>
>>> Should fix ticket #6634
>>>
>>> Signed-off-by: James Almer 
>>> ---
>>> libavformat/aacdec.c | 44 +---
>>> 1 file changed, 29 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
>>> index 8a5450880b..5b00b3f664 100644
>>> --- a/libavformat/aacdec.c
>>> +++ b/libavformat/aacdec.c
>>> @@ -80,10 +80,31 @@ static int adts_aac_probe(const AVProbeData *p)
>>> return 0;
>>> }
>>>
>>> +static int adts_aac_resync(AVFormatContext *s)
>>> +{
>>> +uint16_t state;
>>> +
>>> +// skip data until an ADTS frame is found
>>> +state = avio_r8(s->pb);
>>> +while (!avio_feof(s->pb) && avio_tell(s->pb) < s->probesize) {
>>> +state = (state << 8) | avio_r8(s->pb);
>>> +if ((state >> 4) != 0xFFF)
>>> +continue;
>>> +avio_seek(s->pb, -2, SEEK_CUR);
>>> +break;
>>> +}
>>> +if (s->pb->eof_reached)
>>> +return AVERROR_EOF;
>>> +if ((state >> 4) != 0xFFF)
>>> +return AVERROR_INVALIDDATA;
>>> +
>>> +return 0;
>>> +}
>>
>> Given the importance of this fix, splitting it may make sense.
>>
>> Anyway, thank you!
>>
>> Carl Eugen
> 
> Will split and push later today. Thanks.

Pushed.
___
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] avcodec/hqx: Check the input data against the image size

2019-07-20 Thread Carl Eugen Hoyos



> Something like this doesn't deserve anything but the lowest level of 
> criticism.

But the lowest level of criticism is not allowed here.

Carl Eugen
___
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] avcodec/hqx: Check the input data against the image size

2019-07-20 Thread Lynne
Jul 21, 2019, 12:31 AM by ceffm...@gmail.com:

>
>
>> Am 21.07.2019 um 00:36 schrieb Lynne :
>>
>> Jul 20, 2019, 11:08 PM by mich...@niedermayer.cc:
>>
>>> Fixes: Timeout (22 -> 7 sec)
>>> Fixes: 
>>> 15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992
>>>
>>> Found-by: continuous fuzzing process 
>>> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>>> Signed-off-by: Michael Niedermayer 
>>> ---
>>> libavcodec/hqx.c | 4 
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
>>> index bc24ba91d1..8639d77a41 100644
>>> --- a/libavcodec/hqx.c
>>> +++ b/libavcodec/hqx.c
>>> @@ -471,6 +471,10 @@ static int hqx_decode_frame(AVCodecContext *avctx, 
>>> void *data,
>>> avctx->height  = ctx->height;
>>> avctx->bits_per_raw_sample = 10;
>>>
>>> +if (avctx->coded_width / 16 * (avctx->coded_height / 16) *
>>> +(100 - avctx->discard_damaged_percentage) / 100 > 8LL * 
>>> avpkt->size)
>>> +return AVERROR_INVALIDDATA;
>>> + 
>>>
>>
>> Not only are you ignoring my and others opinion, not only you still continue 
>> sending these awful patches,
>> you've just submitted by far the worst one I've ever seen thinking its okay.
>> Patches like these motivate developers to not even bother including test 
>> samples for new decoders, or even write them. Myself included. Doing exactly 
>> the opposite of what this system's meant to help.
>> Sure, you sent this for review, but how can you even consider this utterly 
>> ridiculous hack for a problem that doesn't exist even worthy for review in 
>> the first place? Just what the fuck?
>>
>
> Ad hominem attacks sadly do not count as reviews.
>

Something like this doesn't deserve anything but the lowest level of criticism.
Can't even be called a patch, so it can't have a review in my opinion.
___
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 v3 3/3] lavf/f_select: make the more pixel format usable to avoid autoscale to rgb

2019-07-20 Thread lance . lmwang
From: Limin Wang 

Below is the tested results for the new added pixel format without autoscale to 
rgb24:
1. AV_PIX_FMT_YUVJ420P
time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact 
-f lavfi \
"sws_flags=+accurate_rnd+bitexact;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,select=gt(scene\,.25)"

master:
pkt_pts=1620|tag:lavfi.scene_score=1.00
pkt_pts=4140|tag:lavfi.scene_score=0.875036
pkt_pts=5800|tag:lavfi.scene_score=1.00
pkt_pts=6720|tag:lavfi.scene_score=0.461625
pkt_pts=8160|tag:lavfi.scene_score=1.00
pkt_pts=9760|tag:lavfi.scene_score=1.00
pkt_pts=14080|tag:lavfi.scene_score=0.838916
pkt_pts=15700|tag:lavfi.scene_score=1.00
pkt_pts=18500|tag:lavfi.scene_score=0.474948
pkt_pts=20040|tag:lavfi.scene_score=0.379700
pkt_pts=21760|tag:lavfi.scene_score=1.00
./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  
0.71s user 0.01s system 99% cpu 0.721 total

patch applied:
pkt_pts=1620|tag:lavfi.scene_score=1.00
pkt_pts=4140|tag:lavfi.scene_score=0.668643
pkt_pts=5800|tag:lavfi.scene_score=0.996721
pkt_pts=6720|tag:lavfi.scene_score=0.357390
pkt_pts=8160|tag:lavfi.scene_score=0.886268
pkt_pts=9760|tag:lavfi.scene_score=0.926219
pkt_pts=14080|tag:lavfi.scene_score=0.650033
pkt_pts=15700|tag:lavfi.scene_score=1.00
pkt_pts=18500|tag:lavfi.scene_score=0.316402
pkt_pts=20040|tag:lavfi.scene_score=0.269509
pkt_pts=21760|tag:lavfi.scene_score=1.00
./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  
0.19s user 0.01s system 81% cpu 0.240 total

2. AV_PIX_FMT_YUV420P
time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact 
-f lavfi \
"sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_1080-sdr.mkv,select=gt(scene\,.2)"
master:
pkt_pts=3587|tag:lavfi.scene_score=0.462364
pkt_pts=4838|tag:lavfi.scene_score=0.419519
pkt_pts=6548|tag:lavfi.scene_score=0.397027
pkt_pts=9968|tag:lavfi.scene_score=0.419245
pkt_pts=12471|tag:lavfi.scene_score=0.413084
pkt_pts=16225|tag:lavfi.scene_score=0.506370
pkt_pts=19645|tag:lavfi.scene_score=0.507538
pkt_pts=22314|tag:lavfi.scene_score=0.504319
pkt_pts=24817|tag:lavfi.scene_score=0.417544
pkt_pts=25651|tag:lavfi.scene_score=0.413916
pkt_pts=26652|tag:lavfi.scene_score=0.487707
18.58s user 0.07s system 99% cpu 18.663 total

patch applied:
pkt_pts=3587|tag:lavfi.scene_score=0.272173
pkt_pts=4838|tag:lavfi.scene_score=0.247841
pkt_pts=6548|tag:lavfi.scene_score=0.233134
pkt_pts=9968|tag:lavfi.scene_score=0.247253
pkt_pts=12471|tag:lavfi.scene_score=0.244129
pkt_pts=16225|tag:lavfi.scene_score=0.302531
pkt_pts=19645|tag:lavfi.scene_score=0.303560
pkt_pts=22314|tag:lavfi.scene_score=0.301861
pkt_pts=24817|tag:lavfi.scene_score=0.249331
pkt_pts=25651|tag:lavfi.scene_score=0.247096
pkt_pts=26652|tag:lavfi.scene_score=0.287728
10.90s user 0.06s system 99% cpu 10.967 total

3. AV_PIX_FMT_YUV422P

time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact 
-f lavfi \
"sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_1080-sdr.mkv,format=yuv422p,select=gt(scene\,.2)"
master:

patched applied:
pkt_pts=3587|tag:lavfi.scene_score=0.224017
pkt_pts=4838|tag:lavfi.scene_score=0.204225
pkt_pts=9968|tag:lavfi.scene_score=0.204636
pkt_pts=12471|tag:lavfi.scene_score=0.202772
pkt_pts=16225|tag:lavfi.scene_score=0.248765
pkt_pts=19645|tag:lavfi.scene_score=0.250144
pkt_pts=22314|tag:lavfi.scene_score=0.248802
pkt_pts=24817|tag:lavfi.scene_score=0.208362
pkt_pts=25651|tag:lavfi.scene_score=0.205777
pkt_pts=26652|tag:lavfi.scene_score=0.230742

4.  AV_PIX_FMT_YUV420P10
time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact 
-f lavfi \
"sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_4k.mkv,select=gt(scene\,.2)"

master:
pkt_pts=3587|tag:lavfi.scene_score=0.269890
pkt_pts=4838|tag:lavfi.scene_score=0.248957
pkt_pts=6548|tag:lavfi.scene_score=0.234619
pkt_pts=9969|tag:lavfi.scene_score=0.224912
pkt_pts=12471|tag:lavfi.scene_score=0.225158
pkt_pts=16225|tag:lavfi.scene_score=0.289809
pkt_pts=19645|tag:lavfi.scene_score=0.285013
pkt_pts=22314|tag:lavfi.scene_score=0.280295
pkt_pts=24817|tag:lavfi.scene_score=0.206486
pkt_pts=25651|tag:lavfi.scene_score=0.208556
pkt_pts=26652|tag:lavfi.scene_score=0.249577
./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  
76.03s user 0.22s system 99% cpu 1:16.27 total

patch applied
pkt_pts=3587|tag:lavfi.scene_score=0.269890
pkt_pts=4838|tag:lavfi.scene_score=0.248957
pkt_pts=6548|tag:lavfi.scene_score=0.234619
pkt_pts=9969|tag:lavfi.scene_score=0.224912
pkt_pts=12471|tag:lavfi.scene_score=0.225158
pkt_pts=16225|tag:lavfi.scene_score=0.289809
pkt_pts=19645|tag:lavfi.scene_score=0.285013
pkt_pts=22314|tag:lavfi.scene_score=0.280295
pkt_pts=24817|tag:lavfi.scene_score=0.206486
pkt_pts=25651|tag:lavfi.scene_score=0.208556
pkt_pts=26652|tag:lavfi.scene_score=0.249577
./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:f

Re: [FFmpeg-devel] [PATCH 4/4] avcodec/hqx: Check the input data against the image size

2019-07-20 Thread Carl Eugen Hoyos


> Am 21.07.2019 um 00:36 schrieb Lynne :
> 
> Jul 20, 2019, 11:08 PM by mich...@niedermayer.cc:
> 
>> Fixes: Timeout (22 -> 7 sec)
>> Fixes: 
>> 15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992
>> 
>> Found-by: continuous fuzzing process 
>> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>> Signed-off-by: Michael Niedermayer 
>> ---
>> libavcodec/hqx.c | 4 
>> 1 file changed, 4 insertions(+)
>> 
>> diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
>> index bc24ba91d1..8639d77a41 100644
>> --- a/libavcodec/hqx.c
>> +++ b/libavcodec/hqx.c
>> @@ -471,6 +471,10 @@ static int hqx_decode_frame(AVCodecContext *avctx, void 
>> *data,
>> avctx->height  = ctx->height;
>> avctx->bits_per_raw_sample = 10;
>> 
>> +if (avctx->coded_width / 16 * (avctx->coded_height / 16) *
>> +(100 - avctx->discard_damaged_percentage) / 100 > 8LL * avpkt->size)
>> +return AVERROR_INVALIDDATA;
>> + 
>> 
> 
> Not only are you ignoring my and others opinion, not only you still continue 
> sending these awful patches,
> you've just submitted by far the worst one I've ever seen thinking its okay.
> Patches like these motivate developers to not even bother including test 
> samples for new decoders, or even write them. Myself included. Doing exactly 
> the opposite of what this system's meant to help.
> Sure, you sent this for review, but how can you even consider this utterly 
> ridiculous hack for a problem that doesn't exist even worthy for review in 
> the first place? Just what the fuck?

Ad hominem attacks sadly do not count as reviews.

Carl Eugen
___
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 v2 1/3] lavf/f_select: support scenecut with more pixel formats

2019-07-20 Thread Limin Wang
On Sat, Jul 20, 2019 at 09:36:37PM +0200, Marton Balint wrote:
> 
> 
> On Sat, 20 Jul 2019, Limin Wang wrote:
> 
> >On Fri, Jul 19, 2019 at 09:26:06PM +0200, Marton Balint wrote:
> >>
> >>
> >>On Fri, 19 Jul 2019, lance.lmw...@gmail.com wrote:
> >>
> >>>From: Limin Wang 
> >>>
> >>>This patch haven't make other pixel format usable yet to make sure the test
> >>>result is same with rgb32 format.
> >>>
> >>>Signed-off-by: Limin Wang 
> >>>---
> >>>libavfilter/f_select.c | 34 ++
> >>>1 file changed, 30 insertions(+), 4 deletions(-)
> >>>
> >>>diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
> >>>index 1132375758..eed8df34cb 100644
> >>>--- a/libavfilter/f_select.c
> >>>+++ b/libavfilter/f_select.c
> >>>@@ -28,6 +28,8 @@
> >>>#include "libavutil/fifo.h"
> >>>#include "libavutil/internal.h"
> >>>#include "libavutil/opt.h"
> >>>+#include "libavutil/imgutils.h"
> >>>+#include "libavutil/pixdesc.h"
> >>>#include "avfilter.h"
> >>>#include "audio.h"
> >>>#include "formats.h"
> >>>@@ -144,6 +146,10 @@ typedef struct SelectContext {
> >>>char *expr_str;
> >>>AVExpr *expr;
> >>>double var_values[VAR_VARS_NB];
> >>>+int bitdepth;
> >>>+int nb_planes;
> >>>+ptrdiff_t width[4];
> >>>+ptrdiff_t height[4];
> >>>int do_scene_detect;///< 1 if the expression requires 
> >>> scene detection variables, 0 otherwise
> >>>ff_scene_sad_fn sad;///< Sum of the absolute difference 
> >>> function (scene detect only)
> >>>double prev_mafd;   ///< previous MAFD 
> >>>   (scene detect only)
> >>>@@ -202,6 +208,17 @@ static av_cold int init(AVFilterContext *ctx)
> >>>static int config_input(AVFilterLink *inlink)
> >>>{
> >>>SelectContext *select = inlink->dst->priv;
> >>>+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> >>>+
> >>>+select->bitdepth = desc->comp[0].depth;
> >>>+select->nb_planes = av_pix_fmt_count_planes(inlink->format);
> >>>+for (int plane = 0; plane < select->nb_planes; plane++) {
> >>>+ptrdiff_t line_size = av_image_get_linesize(inlink->format, 
> >>>inlink->w, plane);
> >>>+int vsub = desc->log2_chroma_h;
> >>>+
> >>>+select->width[plane] = line_size >> (select->bitdepth > 8);
> >>>+select->height[plane] = plane == 1 || plane == 2 ?  
> >>>AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
> >>>+}
> >>>
> >>>select->var_values[VAR_N]  = 0.0;
> >>>select->var_values[VAR_SELECTED_N] = 0.0;
> >>>@@ -242,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
> >>>inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
> >>>
> >>>if (CONFIG_SELECT_FILTER && select->do_scene_detect) {
> >>>-select->sad = ff_scene_sad_get_fn(8);
> >>>+select->sad = ff_scene_sad_get_fn(select->bitdepth == 8 ? 8 : 16);
> >>>if (!select->sad)
> >>>return AVERROR(EINVAL);
> >>>}
> >>>@@ -258,12 +275,21 @@ static double get_scene_score(AVFilterContext *ctx, 
> >>>AVFrame *frame)
> >>>if (prev_picref &&
> >>>frame->height == prev_picref->height &&
> >>>frame->width  == prev_picref->width) {
> >>>-uint64_t sad;
> >>>+uint64_t sad = 0;
> >>>double mafd, diff;
> >>>+int count = 0;
> >>>+
> >>>+for (int plane = 0; plane < select->nb_planes; plane++) {
> >>>+uint64_t plane_sad;
> >>>+select->sad(prev_picref->data[plane], 
> >>>prev_picref->linesize[plane],
> >>>+frame->data[plane], frame->linesize[plane],
> >>>+select->width[plane], select->height[plane], 
> >>>&plane_sad);
> >>>+sad += plane_sad;
> >>>+count += select->width[plane] * select->height[plane];
> >>>+}
> >>>
> >>>-select->sad(prev_picref->data[0], prev_picref->linesize[0], 
> >>>frame->data[0], frame->linesize[0], frame->width * 3, frame->height, &sad);
> >>>emms_c();
> >>>-mafd = (double)sad / (frame->width * 3 * frame->height);
> >>>+mafd = (double)sad / count;
> >>
> >>Still missing normalization to [0..255] here for >8 bitdepth.
> >By the testing, Passengers_Breakfast_4K.mkv is 10bits sample, it can't 
> >detect the scenecut if using 1< 
> You should divide by (1 << (bitdepth - 8)), since you should be
> normalizing to 0..255 here.
> 
Yes, Now I have check the result, it's expected. I have updated the patch. 

> >Or just remove yuv420p10 support, it's the only 10bit enable pixel format in 
> >the 3/3 patch?
> >After get more sample for testing it's OK, then change for bitdepth > 8
> 
> You should get the same scores for 10bit and 8bit. (e.g. YUV420P and
> YUV420P10).
> 
> Regards,
> 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-devel] [PATCH v3 2/3] fate: change the scenecut fate threshold for one more scenecut scenes

2019-07-20 Thread lance . lmwang
From: Limin Wang 

why change .4 to .25, it's for:
one scenecut(pkt_pts=20040) isn't detected by 0.4 threshold

why not change to 0.25 instead of .3:
it'll cause this scenecut(pkt_pts=20040) failed to detect after applied the next
patch which enable yuvj420

for fate testing, it's better to catch all scenecut scenes.

Reviewed-by: Marton Balint 
Signed-off-by: Limin Wang 
---
 tests/fate/filter-video.mak| 2 +-
 tests/ref/fate/filter-metadata-scenedetect | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 1042e96..60c6be1 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -734,7 +734,7 @@ SCENEDETECT_DEPS = FFPROBE LAVFI_INDEV MOVIE_FILTER 
SELECT_FILTER SCALE_FILTER \
AVCODEC AVDEVICE MOV_DEMUXER SVQ3_DECODER ZLIB
 FATE_METADATA_FILTER-$(call ALLYES, $(SCENEDETECT_DEPS)) += 
fate-filter-metadata-scenedetect
 fate-filter-metadata-scenedetect: SRC = 
$(TARGET_SAMPLES)/svq3/Vertical400kbit.sorenson3.mov
-fate-filter-metadata-scenedetect: CMD = run $(FILTER_METADATA_COMMAND) 
"sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',select=gt(scene\,.4)"
+fate-filter-metadata-scenedetect: CMD = run $(FILTER_METADATA_COMMAND) 
"sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',select=gt(scene\,.25)"
 
 CROPDETECT_DEPS = FFPROBE LAVFI_INDEV MOVIE_FILTER CROPDETECT_FILTER 
SCALE_FILTER \
   AVCODEC AVDEVICE MOV_DEMUXER H264_DECODER
diff --git a/tests/ref/fate/filter-metadata-scenedetect 
b/tests/ref/fate/filter-metadata-scenedetect
index d04054a..67c23b3 100644
--- a/tests/ref/fate/filter-metadata-scenedetect
+++ b/tests/ref/fate/filter-metadata-scenedetect
@@ -7,4 +7,5 @@ pkt_pts=9760|tag:lavfi.scene_score=1.00
 pkt_pts=14080|tag:lavfi.scene_score=0.838916
 pkt_pts=15700|tag:lavfi.scene_score=1.00
 pkt_pts=18500|tag:lavfi.scene_score=0.474948
+pkt_pts=20040|tag:lavfi.scene_score=0.379700
 pkt_pts=21760|tag:lavfi.scene_score=1.00
-- 
2.6.4

___
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 v3 1/3] lavf/f_select: support scenecut with more pixel formats

2019-07-20 Thread lance . lmwang
From: Limin Wang 

This patch haven't make other pixel format usable yet to make sure the test
result is same with rgb32 format.

Reviewed-by: Marton Balint 
Signed-off-by: Limin Wang 
---
 libavfilter/f_select.c | 34 ++
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 1132375..b872cee 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -28,6 +28,8 @@
 #include "libavutil/fifo.h"
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "audio.h"
 #include "formats.h"
@@ -144,6 +146,10 @@ typedef struct SelectContext {
 char *expr_str;
 AVExpr *expr;
 double var_values[VAR_VARS_NB];
+int bitdepth;
+int nb_planes;
+ptrdiff_t width[4];
+ptrdiff_t height[4];
 int do_scene_detect;///< 1 if the expression requires scene 
detection variables, 0 otherwise
 ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
 double prev_mafd;   ///< previous MAFD 
  (scene detect only)
@@ -202,6 +208,17 @@ static av_cold int init(AVFilterContext *ctx)
 static int config_input(AVFilterLink *inlink)
 {
 SelectContext *select = inlink->dst->priv;
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
+
+select->bitdepth = desc->comp[0].depth;
+select->nb_planes = av_pix_fmt_count_planes(inlink->format);
+for (int plane = 0; plane < select->nb_planes; plane++) {
+ptrdiff_t line_size = av_image_get_linesize(inlink->format, inlink->w, 
plane);
+int vsub = desc->log2_chroma_h;
+
+select->width[plane] = line_size >> (select->bitdepth > 8);
+select->height[plane] = plane == 1 || plane == 2 ?  
AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
+}
 
 select->var_values[VAR_N]  = 0.0;
 select->var_values[VAR_SELECTED_N] = 0.0;
@@ -242,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
 
 if (CONFIG_SELECT_FILTER && select->do_scene_detect) {
-select->sad = ff_scene_sad_get_fn(8);
+select->sad = ff_scene_sad_get_fn(select->bitdepth == 8 ? 8 : 16);
 if (!select->sad)
 return AVERROR(EINVAL);
 }
@@ -258,12 +275,21 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *frame)
 if (prev_picref &&
 frame->height == prev_picref->height &&
 frame->width  == prev_picref->width) {
-uint64_t sad;
+uint64_t sad = 0;
 double mafd, diff;
+int count = 0;
+
+for (int plane = 0; plane < select->nb_planes; plane++) {
+uint64_t plane_sad;
+select->sad(prev_picref->data[plane], prev_picref->linesize[plane],
+frame->data[plane], frame->linesize[plane],
+select->width[plane], select->height[plane], &plane_sad);
+sad += plane_sad;
+count += select->width[plane] * select->height[plane];
+}
 
-select->sad(prev_picref->data[0], prev_picref->linesize[0], 
frame->data[0], frame->linesize[0], frame->width * 3, frame->height, &sad);
 emms_c();
-mafd = (double)sad / (frame->width * 3 * frame->height);
+mafd = (double)sad / count / (1ULL << (select->bitdepth - 8));
 diff = fabs(mafd - select->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
 select->prev_mafd = mafd;
-- 
2.6.4

___
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] avcodec/hqx: Check the input data against the image size

2019-07-20 Thread Lynne
Jul 20, 2019, 11:08 PM by mich...@niedermayer.cc:

> Fixes: Timeout (22 -> 7 sec)
> Fixes: 
> 15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992
>
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/hqx.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
> index bc24ba91d1..8639d77a41 100644
> --- a/libavcodec/hqx.c
> +++ b/libavcodec/hqx.c
> @@ -471,6 +471,10 @@ static int hqx_decode_frame(AVCodecContext *avctx, void 
> *data,
>  avctx->height  = ctx->height;
>  avctx->bits_per_raw_sample = 10;
>  
> +if (avctx->coded_width / 16 * (avctx->coded_height / 16) *
> +(100 - avctx->discard_damaged_percentage) / 100 > 8LL * avpkt->size)
> +return AVERROR_INVALIDDATA;
> + 
>

Not only are you ignoring my and others opinion, not only you still continue 
sending these awful patches,
you've just submitted by far the worst one I've ever seen thinking its okay.
Patches like these motivate developers to not even bother including test 
samples for new decoders, or even write them. Myself included. Doing exactly 
the opposite of what this system's meant to help.
Sure, you sent this for review, but how can you even consider this utterly 
ridiculous hack for a problem that doesn't exist even worthy for review in the 
first place? Just what the fuck?
___
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/4] avformat/vividas: forward errors from track_header()

2019-07-20 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/vividas.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 184d24f374..1895c75858 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -273,7 +273,7 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned 
*size,
 return buf;
 }
 
-static void track_header(VividasDemuxContext *viv, AVFormatContext *s,  
uint8_t *buf, int size)
+static int track_header(VividasDemuxContext *viv, AVFormatContext *s,  uint8_t 
*buf, int size)
 {
 int i,j;
 int64_t off;
@@ -283,7 +283,7 @@ static void track_header(VividasDemuxContext *viv, 
AVFormatContext *s,  uint8_t
 
 pb = avio_alloc_context(buf, size, 0, NULL, NULL, NULL, NULL);
 if (!pb)
-return;
+return AVERROR(ENOMEM);
 
 ffio_read_varlen(pb); // track_header_len
 avio_r8(pb); // '1'
@@ -380,7 +380,7 @@ static void track_header(VividasDemuxContext *viv, 
AVFormatContext *s,  uint8_t
 
 st->codecpar->extradata_size = 64 + xd_size + xd_size / 255;
 if (ff_alloc_extradata(st->codecpar, st->codecpar->extradata_size))
-return;
+return AVERROR(ENOMEM);
 
 p = st->codecpar->extradata;
 p[0] = 2;
@@ -404,6 +404,7 @@ static void track_header(VividasDemuxContext *viv, 
AVFormatContext *s,  uint8_t
 }
 
 av_free(pb);
+return 0;
 }
 
 static void track_index(VividasDemuxContext *viv, AVFormatContext *s, uint8_t 
*buf, unsigned size)
@@ -506,6 +507,7 @@ static int viv_read_header(AVFormatContext *s)
 uint32_t b22_size = 0;
 uint32_t b22_key = 0;
 uint8_t *buf = 0;
+int ret;
 
 avio_skip(pb, 9);
 
@@ -561,8 +563,10 @@ static int viv_read_header(AVFormatContext *s)
 buf = read_vblock(pb, &v, key, &k2, 0);
 if (!buf)
 return AVERROR(EIO);
-track_header(viv, s, buf, v);
+ret = track_header(viv, s, buf, v);
 av_free(buf);
+if (ret < 0)
+return ret;
 
 buf = read_vblock(pb, &v, key, &k2, v);
 if (!buf)
-- 
2.22.0

___
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/4] avformat/vividas: Check that value from ffio_read_varlen() does not overflow

2019-07-20 Thread Michael Niedermayer
Fixes: signed integer overflow: -1241665686 + -1340629419 cannot be represented 
in type 'int'
Fixes: 
15922/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5692826442006528

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

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 1895c75858..c3d3cf548c 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -374,8 +374,11 @@ static int track_header(VividasDemuxContext *viv, 
AVFormatContext *s,  uint8_t *
 ffio_read_varlen(pb); // len_3
 num_data = avio_r8(pb);
 for (j = 0; j < num_data; j++) {
-data_len[j] = ffio_read_varlen(pb);
-xd_size += data_len[j];
+uint64_t len = ffio_read_varlen(pb);
+if (len > INT_MAX/2 - xd_size)
+return AVERROR_INVALIDDATA;
+data_len[j] = len;
+xd_size += len;
 }
 
 st->codecpar->extradata_size = 64 + xd_size + xd_size / 255;
-- 
2.22.0

___
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 4/4] avcodec/hqx: Check the input data against the image size

2019-07-20 Thread Michael Niedermayer
Fixes: Timeout (22 -> 7 sec)
Fixes: 
15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992

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

diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index bc24ba91d1..8639d77a41 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -471,6 +471,10 @@ static int hqx_decode_frame(AVCodecContext *avctx, void 
*data,
 avctx->height  = ctx->height;
 avctx->bits_per_raw_sample = 10;
 
+if (avctx->coded_width / 16 * (avctx->coded_height / 16) *
+(100 - avctx->discard_damaged_percentage) / 100 > 8LL * avpkt->size)
+return AVERROR_INVALIDDATA;
+
 switch (ctx->format) {
 case HQX_422:
 avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
-- 
2.22.0

___
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/4] avcodec/utils: Check close before calling it

2019-07-20 Thread Michael Niedermayer
Fixes: NULL pointer dereference
Fixes: 
15733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IDF_fuzzer-5658616977162240

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

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 9ff9628f7f..66c68d1cf5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1024,7 +1024,7 @@ end:
 
 return ret;
 free_and_end:
-if (avctx->codec &&
+if (avctx->codec && avctx->codec->close &&
 (codec_init_ok ||
  (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
 avctx->codec->close(avctx);
-- 
2.22.0

___
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 v2 1/3] lavf/f_select: support scenecut with more pixel formats

2019-07-20 Thread Marton Balint



On Sat, 20 Jul 2019, Limin Wang wrote:


On Fri, Jul 19, 2019 at 09:26:06PM +0200, Marton Balint wrote:



On Fri, 19 Jul 2019, lance.lmw...@gmail.com wrote:

>From: Limin Wang 
>
>This patch haven't make other pixel format usable yet to make sure the test
>result is same with rgb32 format.
>
>Signed-off-by: Limin Wang 
>---
>libavfilter/f_select.c | 34 ++
>1 file changed, 30 insertions(+), 4 deletions(-)
>
>diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
>index 1132375758..eed8df34cb 100644
>--- a/libavfilter/f_select.c
>+++ b/libavfilter/f_select.c
>@@ -28,6 +28,8 @@
>#include "libavutil/fifo.h"
>#include "libavutil/internal.h"
>#include "libavutil/opt.h"
>+#include "libavutil/imgutils.h"
>+#include "libavutil/pixdesc.h"
>#include "avfilter.h"
>#include "audio.h"
>#include "formats.h"
>@@ -144,6 +146,10 @@ typedef struct SelectContext {
>char *expr_str;
>AVExpr *expr;
>double var_values[VAR_VARS_NB];
>+int bitdepth;
>+int nb_planes;
>+ptrdiff_t width[4];
>+ptrdiff_t height[4];
>int do_scene_detect;///< 1 if the expression requires scene 
detection variables, 0 otherwise
>ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
>double prev_mafd;   ///< previous MAFD 
  (scene detect only)
>@@ -202,6 +208,17 @@ static av_cold int init(AVFilterContext *ctx)
>static int config_input(AVFilterLink *inlink)
>{
>SelectContext *select = inlink->dst->priv;
>+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
>+
>+select->bitdepth = desc->comp[0].depth;
>+select->nb_planes = av_pix_fmt_count_planes(inlink->format);
>+for (int plane = 0; plane < select->nb_planes; plane++) {
>+ptrdiff_t line_size = av_image_get_linesize(inlink->format, 
inlink->w, plane);
>+int vsub = desc->log2_chroma_h;
>+
>+select->width[plane] = line_size >> (select->bitdepth > 8);
>+select->height[plane] = plane == 1 || plane == 2 ?  
AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
>+}
>
>select->var_values[VAR_N]  = 0.0;
>select->var_values[VAR_SELECTED_N] = 0.0;
>@@ -242,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
>inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
>
>if (CONFIG_SELECT_FILTER && select->do_scene_detect) {
>-select->sad = ff_scene_sad_get_fn(8);
>+select->sad = ff_scene_sad_get_fn(select->bitdepth == 8 ? 8 : 16);
>if (!select->sad)
>return AVERROR(EINVAL);
>}
>@@ -258,12 +275,21 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *frame)
>if (prev_picref &&
>frame->height == prev_picref->height &&
>frame->width  == prev_picref->width) {
>-uint64_t sad;
>+uint64_t sad = 0;
>double mafd, diff;
>+int count = 0;
>+
>+for (int plane = 0; plane < select->nb_planes; plane++) {
>+uint64_t plane_sad;
>+select->sad(prev_picref->data[plane], 
prev_picref->linesize[plane],
>+frame->data[plane], frame->linesize[plane],
>+select->width[plane], select->height[plane], &plane_sad);
>+sad += plane_sad;
>+count += select->width[plane] * select->height[plane];
>+}
>
>-select->sad(prev_picref->data[0], prev_picref->linesize[0], frame->data[0], 
frame->linesize[0], frame->width * 3, frame->height, &sad);
>emms_c();
>-mafd = (double)sad / (frame->width * 3 * frame->height);
>+mafd = (double)sad / count;

Still missing normalization to [0..255] here for >8 bitdepth.

By the testing, Passengers_Breakfast_4K.mkv is 10bits sample, it can't detect the 
scenecut if using 1<

You should divide by (1 << (bitdepth - 8)), since you should be 
normalizing to 0..255 here.



Or just remove yuv420p10 support, it's the only 10bit enable pixel format in 
the 3/3 patch?
After get more sample for testing it's OK, then change for bitdepth > 8


You should get the same scores for 10bit and 8bit. (e.g. YUV420P and 
YUV420P10).


Regards,
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".

[FFmpeg-devel] [PATCH] avformat/mov: fix return code for trun box with no sample entries

2019-07-20 Thread Gyan


Affected files can now be demuxed. Verified with John Stebbins. FATE passes.

Gyan
From 48175cd745f8abd0546487907c4596550e3c73bf Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Sat, 20 Jul 2019 23:44:14 +0530
Subject: [PATCH] avformat/mov: fix return code for trun box with no sample
 entries

A value of zero for sample_count in trun box is not
prohibited by 14496-12 section 8.8.8. 4a9d32baca
disallowed this which led the demuxer to error out
when reading the header of valid files.
---
 libavformat/mov.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 327a25bbdf..ea26d78d91 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4776,13 +4776,14 @@ static int mov_read_trun(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 distance = 0;
 av_log(c->fc, AV_LOG_TRACE, "first sample flags 0x%x\n", 
first_sample_flags);
 
+if (entries == 0)
+return 0;
+
 // realloc space for new index entries
 if((uint64_t)st->nb_index_entries + entries >= UINT_MAX / 
sizeof(AVIndexEntry)) {
 entries = UINT_MAX / sizeof(AVIndexEntry) - st->nb_index_entries;
 av_log(c->fc, AV_LOG_ERROR, "Failed to add index entry\n");
 }
-if (entries <= 0)
-return -1;
 
 requested_size = (st->nb_index_entries + entries) * sizeof(AVIndexEntry);
 new_entries = av_fast_realloc(st->index_entries,
-- 
2.22.0___
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] avcodec/dvbsubdec: Use ff_set_dimensions()

2019-07-20 Thread Michael Niedermayer
On Sat, Jul 20, 2019 at 11:02:35AM +0200, Paul B Mahol wrote:
> On 7/20/19, Michael Niedermayer  wrote:
> > Fixes: signed integer overflow: 65313 * 65313 cannot be represented in type
> > 'int'
> > Fixes:
> > 15740/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-5641749164195840
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/dvbsubdec.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> > index bc4a17bde0..6e7e13b6eb 100644
> > --- a/libavcodec/dvbsubdec.c
> > +++ b/libavcodec/dvbsubdec.c
> > @@ -1578,8 +1578,9 @@ static int
> > dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
> >  display_def->width   = bytestream_get_be16(&buf) + 1;
> >  display_def->height  = bytestream_get_be16(&buf) + 1;
> >  if (!avctx->width || !avctx->height) {
> > -avctx->width  = display_def->width;
> > -avctx->height = display_def->height;
> > +int ret = ff_set_dimensions(avctx, display_def->width,
> > display_def->height);
> > +if (ret < 0)
> > +return ret;
> >  }
> >
> >  if (info_byte & 1<<3) { // display_window_flag
> > --
> > 2.22.0
> >
> 
> LGTM

will apply

thanks

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

Never trust a computer, one day, it may think you are the virus. -- Compn


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 v2] avcodec/tak_parser: don't return error values

2019-07-20 Thread James Almer
On 7/20/2019 1:29 PM, Michael Niedermayer wrote:
> On Thu, Jul 18, 2019 at 07:37:57PM -0300, James Almer wrote:
>> The API does not allow it.
>>
>> Also set poutbuf and poutbuf_size to NULL/0 on error to avoid leaving
>> them uninitialized.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/tak_parser.c | 20 
>>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> probably ok
> 
> Thanks

Pushed.
___
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 v2] avcodec/tak_parser: don't return error values

2019-07-20 Thread Michael Niedermayer
On Thu, Jul 18, 2019 at 07:37:57PM -0300, James Almer wrote:
> The API does not allow it.
> 
> Also set poutbuf and poutbuf_size to NULL/0 on error to avoid leaving
> them uninitialized.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/tak_parser.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)

probably ok

Thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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 1/2] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

2019-07-20 Thread Michael Niedermayer
On Thu, Jul 18, 2019 at 10:22:23PM +0200, Michael Niedermayer wrote:
> On Thu, Jul 18, 2019 at 02:44:46PM +, Eoff, Ullysses A wrote:
> > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of 
> > > Michael Niedermayer
> > > On Mon, Jul 15, 2019 at 06:38:35PM +0800, Linjie Fu wrote:
> > > > +{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC |
> > > > +  OPT_EXPERT | OPT_INPUT,  
> > > >   { .off = OFFSET(autoscale) },
> > > > +"automatically insert correct scale filters" },
> > > 
> > > I think this description is inadequate to understand what the option does.
> > > Scale filters are inserted at various places (for example within a filter
> > > graph). This option here affects a specific case.
> > > 
> > 
> > Would this be sufficient?
> > 
> > "automatically insert a scale filter to scale the output of all frames to
> >   match the resolution of the initial frame"
> 
> this sounds better, yes
> 
> 
> > 
> > If not, any other suggestions?
> 
> maybe it could say how this relates to the filter graph/chain. 
> the user doenst know from this if this occurs before or after the
> filter graph.
> 
> 
> Also what happens when a encoder/muxer does not support this ?

I presume it fails in this case and if so a flag is needed
something like AV_CODEC_CAP_VARIABLE_DIMENSIONS

This would also decrease the number of cases where this doesnt
work without providing a clear error message

Thanks

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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/aacdec: resync to the next aac sample on invalid data instead of aborting

2019-07-20 Thread James Almer
On 7/20/2019 12:33 PM, Carl Eugen Hoyos wrote:
> 
> 
> 
>> Am 20.07.2019 um 15:13 schrieb James Almer :
>>
>> Should fix ticket #6634
>>
>> Signed-off-by: James Almer 
>> ---
>> libavformat/aacdec.c | 44 +---
>> 1 file changed, 29 insertions(+), 15 deletions(-)
>>
>> diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
>> index 8a5450880b..5b00b3f664 100644
>> --- a/libavformat/aacdec.c
>> +++ b/libavformat/aacdec.c
>> @@ -80,10 +80,31 @@ static int adts_aac_probe(const AVProbeData *p)
>> return 0;
>> }
>>
>> +static int adts_aac_resync(AVFormatContext *s)
>> +{
>> +uint16_t state;
>> +
>> +// skip data until an ADTS frame is found
>> +state = avio_r8(s->pb);
>> +while (!avio_feof(s->pb) && avio_tell(s->pb) < s->probesize) {
>> +state = (state << 8) | avio_r8(s->pb);
>> +if ((state >> 4) != 0xFFF)
>> +continue;
>> +avio_seek(s->pb, -2, SEEK_CUR);
>> +break;
>> +}
>> +if (s->pb->eof_reached)
>> +return AVERROR_EOF;
>> +if ((state >> 4) != 0xFFF)
>> +return AVERROR_INVALIDDATA;
>> +
>> +return 0;
>> +}
> 
> Given the importance of this fix, splitting it may make sense.
> 
> Anyway, thank you!
> 
> Carl Eugen

Will split and push later today. 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] avformat/aacdec: resync to the next aac sample on invalid data instead of aborting

2019-07-20 Thread Carl Eugen Hoyos



> Am 20.07.2019 um 15:13 schrieb James Almer :
> 
> Should fix ticket #6634
> 
> Signed-off-by: James Almer 
> ---
> libavformat/aacdec.c | 44 +---
> 1 file changed, 29 insertions(+), 15 deletions(-)
> 
> diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
> index 8a5450880b..5b00b3f664 100644
> --- a/libavformat/aacdec.c
> +++ b/libavformat/aacdec.c
> @@ -80,10 +80,31 @@ static int adts_aac_probe(const AVProbeData *p)
> return 0;
> }
> 
> +static int adts_aac_resync(AVFormatContext *s)
> +{
> +uint16_t state;
> +
> +// skip data until an ADTS frame is found
> +state = avio_r8(s->pb);
> +while (!avio_feof(s->pb) && avio_tell(s->pb) < s->probesize) {
> +state = (state << 8) | avio_r8(s->pb);
> +if ((state >> 4) != 0xFFF)
> +continue;
> +avio_seek(s->pb, -2, SEEK_CUR);
> +break;
> +}
> +if (s->pb->eof_reached)
> +return AVERROR_EOF;
> +if ((state >> 4) != 0xFFF)
> +return AVERROR_INVALIDDATA;
> +
> +return 0;
> +}

Given the importance of this fix, splitting it may make sense.

Anyway, thank you!

Carl Eugen
___
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 v2] avcodec/cbs_h265: add support for Alpha Channel Info SEI messages

2019-07-20 Thread James Almer
On 7/20/2019 10:54 AM, Mark Thompson wrote:
> On 09/07/2019 22:27, James Almer wrote:
>> As defined in sections F.14.2.8 and F.14.3.8
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/cbs_h2645.c|  1 +
>>  libavcodec/cbs_h265.h | 12 +++
>>  libavcodec/cbs_h265_syntax_template.c | 29 +++
>>  libavcodec/hevc_sei.h |  1 +
>>  4 files changed, 43 insertions(+)
> 
> LGTM.
> 
> Thanks,
> 
> - Mark

Applied.
___
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 v2] avcodec/cbs_h265: add support for Alpha Channel Info SEI messages

2019-07-20 Thread Mark Thompson
On 09/07/2019 22:27, James Almer wrote:
> As defined in sections F.14.2.8 and F.14.3.8
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/cbs_h2645.c|  1 +
>  libavcodec/cbs_h265.h | 12 +++
>  libavcodec/cbs_h265_syntax_template.c | 29 +++
>  libavcodec/hevc_sei.h |  1 +
>  4 files changed, 43 insertions(+)

LGTM.

Thanks,

- Mark
___
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] vp3data, mpc8huff: Make some arrays unsigned to prevent overflow

2019-07-20 Thread Andreas Rheinhardt
Some of the VP3 arrays (namely vp31_intra_y_dequant, vp31_intra_c_dequant
and vp31_inter_dequant) are currently declared as array of (const) int8_t
despite them being only used to directly initialize an array of uint8_t.
vp31_inter_dequant even contains the value 128 which is not
representible in int8_t and might generate overflow warnings by
compilers.

Similarly, mpc8_q4_syms is an array of int8_t that is initialized using
values not in the range of an int8_t and that is only accessed via
a pointer to uint8_t in ff_init_vlc_sparse. The latter applies to all
the other *_bits and *_syms tables in mpc8huff.h, so make them all
unsigned.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/mpc8huff.h | 34 +-
 libavcodec/vp3data.h  |  6 +++---
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/libavcodec/mpc8huff.h b/libavcodec/mpc8huff.h
index 8491037aa4..0566c910ca 100644
--- a/libavcodec/mpc8huff.h
+++ b/libavcodec/mpc8huff.h
@@ -34,7 +34,7 @@ static const uint8_t mpc8_bands_codes[MPC8_BANDS_SIZE] = {
  0x08, 0x09, 0x06, 0x07, 0x05, 0x05, 0x03, 0x03,
  0x01,
 };
-static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
+static const uint8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
   1,  3,  5,  6,  7,  8,  8,  9,
  10, 11, 12, 12, 12, 13, 12, 12,
  12, 12, 12, 13, 12, 12, 12, 11,
@@ -48,7 +48,7 @@ static const int8_t mpc8_bands_bits[MPC8_BANDS_SIZE] = {
 static const uint8_t mpc8_scfi0_codes[MPC8_SCFI0_SIZE] = {
  0x00, 0x01, 0x01, 0x01,
 };
-static const int8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
+static const uint8_t mpc8_scfi0_bits[MPC8_SCFI0_SIZE] = {
   3,  3,  1,  2,
 };
 
@@ -60,7 +60,7 @@ static const uint8_t mpc8_scfi1_codes[MPC8_SCFI1_SIZE] = {
  0x04, 0x06, 0x02, 0x02, 0x05, 0x07, 0x03, 0x03,
 
 };
-static const int8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
+static const uint8_t mpc8_scfi1_bits[MPC8_SCFI1_SIZE] = {
   6,  7,  6,  6,  7,  5,  5,  5,
   6,  5,  2,  3,  6,  5,  3,  2,
 
@@ -79,7 +79,7 @@ static const uint8_t mpc8_dscf0_codes[MPC8_DSCF0_SIZE] = {
  0x0C, 0x0D, 0x07, 0x08, 0x09, 0x06, 0x07, 0x03,
  0x04, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
 };
-static const int8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
+static const uint8_t mpc8_dscf0_bits[MPC8_DSCF0_SIZE] = {
  12, 12, 12, 11, 11, 11, 10, 10,
  10, 10, 10,  9,  9,  9,  9,  8,
   8,  8,  8,  7,  7,  7,  7,  6,
@@ -105,7 +105,7 @@ static const uint8_t mpc8_dscf1_codes[MPC8_DSCF1_SIZE] = {
  0x05, 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05,
  0x0D,
 };
-static const int8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
+static const uint8_t mpc8_dscf1_bits[MPC8_DSCF1_SIZE] = {
  15, 14, 14, 13, 13, 13, 12, 12,
  12, 12, 11, 11, 11, 11, 10, 10,
  10, 10,  9,  9,  9,  8,  8,  7,
@@ -132,7 +132,7 @@ static const uint8_t mpc8_res_codes[2][MPC8_RES_SIZE] = {
 0x03,
   }
 };
-static const int8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
+static const uint8_t mpc8_res_bits[2][MPC8_RES_SIZE] = {
   {
  1,  2,  4,  5,  6,  7,  9, 10,
 11, 12, 13, 14, 15, 16, 16,  8,
@@ -153,7 +153,7 @@ static const uint8_t mpc8_q1_codes[MPC8_Q1_SIZE] = {
  0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
  0x01, 0x00, 0x01,
 };
-static const int8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
+static const uint8_t mpc8_q1_bits[MPC8_Q1_SIZE] = {
   6,  4,  4,  3,  3,  3,  3,  3,
   4,  4,  4,  5,  7,  8,  9, 10,
  11, 12, 12,
@@ -196,7 +196,7 @@ static const uint8_t mpc8_q9up_codes[MPC8_Q9UP_SIZE] = {
  0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
  0x4A, 0x4B, 0x06, 0x07, 0x08, 0x09, 0x00, 0x01,
 };
-static const int8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
+static const uint8_t mpc8_q9up_bits[MPC8_Q9UP_SIZE] = {
  10, 10, 10, 10, 10,  9,  9,  9,
   9,  9,  9,  9,  9,  9,  9,  9,
   9,  9,  9,  8,  8,  9,  9,  9,
@@ -272,7 +272,7 @@ static const uint8_t mpc8_q2_codes[2][MPC8_Q2_SIZE] = {
  0x03, 0x1C, 0x17, 0x1D, 0x05,
 }
 };
-static const int8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
+static const uint8_t mpc8_q2_bits[2][MPC8_Q2_SIZE] = {
 {
  12, 11, 10, 11, 13, 11,  9,  8,
   9, 11, 11,  8,  7,  8, 11, 11,
@@ -324,7 +324,7 @@ static const uint8_t mpc8_q3_codes[MPC8_Q3_SIZE] = {
  0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
  0x00,
 };
-static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
+static const uint8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
   3,  4,  4,  4,  4,  4,  4,  5,
   5,  5,  5,  5,  5,  6,  6,  6,
   6,  6,  6,  6,  6,  6,  6,  6,
@@ -333,7 +333,7 @@ static const int8_t mpc8_q3_bits[MPC8_Q3_SIZE] = {
   8,  8,  8,  8,  8,  9,  9,  9,
   9,
 };
-static const int8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
+static const uint8_t mpc8_q3_syms[MPC8_Q3_SIZE] = {
48,65,64,49,63,32,47,80,
79,50,62,33,16,82,81,95,
94,66,78,34,46,17,31,30,
@@ -360,7 +360,7 @@ static const uint8_t mpc8_q4_codes[MPC8_Q4_SIZE] = {
  0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x01,
  0x00,
 };
-static const int8_t mpc8_q4_bits[MPC8_Q4_SIZE] = {
+static const uint8_t mpc8_q4_b

Re: [FFmpeg-devel] [PATCH 2/3] lavfi: modify avfilter_get_matrix to support separate scale factors

2019-07-20 Thread Nicolas George
Mark Thompson (12019-07-20):
> Apologies for not noticing this when we talked about it earlier, but
> this function is actually user-visible - it's global with an exported
> prefix
> ().
> That means the API/ABI is fixed and you shouldn't be changing the
> signature.

It is not defined in an installed header, so it is not part of the
public API. You can ignore the issue: anybody who uses it did some
cheating and knows it. But better rename it so that it is no longer
exported.

Regards,

-- 
  Nicolas George


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] cbs_h2645: Fix infinite loop in more_rbsp_data

2019-07-20 Thread Mark Thompson
On 05/06/2019 03:18, Andreas Rheinhardt wrote:
> cbs_h2645_read_more_rbsp_data does not handle malformed input very well:
> 1. If there were <= 8 bits left in the bitreader, these bits were read
> via show_bits. But show_bits requires the number of bits to be read to
> be > 0 (internally it shifts by 32 - number of bits to be read which is
> undefined behaviour if said number is zero; there is also an assert for
> this, but it is only an av_assert2). Furthermore, in this case a shift
> by -1 was performed which is of course undefined behaviour, too.
> 2. If there were > 0 and <= 8 bits left and all of them were zero
> (this can only happen for defective input), it was reported that there
> was further RBSP data.
> 
> This can lead to an infinite loop in H.265's cbs_h265_read_extension_data
> corresponding to the [vsp]ps_extension_data_flag syntax elements. If the
> relevant flag indicates the (potential) occurence of these syntax elements,
> while all bits after this flag are zero, cbs_h2645_read_more_rbsp_data
> always returns 1 on x86. Given that a checked bitstream reader is used,
> we are also not "saved" by an overflow in the bitstream reader's index.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/cbs_h2645.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> index 0456937710..becb63a290 100644
> --- a/libavcodec/cbs_h2645.c
> +++ b/libavcodec/cbs_h2645.c
> @@ -328,9 +328,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext 
> *gbc)
>  int bits_left = get_bits_left(gbc);
>  if (bits_left > 8)
>  return 1;
> -if (show_bits(gbc, bits_left) == 1 << (bits_left - 1))
> +if (bits_left == 0)
>  return 0;
> -return 1;
> +if (show_bits(gbc, bits_left) & MAX_UINT_BITS(bits_left - 1))
> +return 1;
> +return 0;
>  }
>  
>  #define more_rbsp_data(var) ((var) = cbs_h2645_read_more_rbsp_data(rw))
> 

Good catch!  Applied.

Thanks,

- Mark
___
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 2/3] lavfi: modify avfilter_get_matrix to support separate scale factors

2019-07-20 Thread Mark Thompson
On 20/07/2019 00:19, Jarek Samic wrote:
> ---
>  libavfilter/transform.c  | 13 ++---
>  libavfilter/transform.h  | 30 +++---
>  libavfilter/vf_deshake.c |  7 +--
>  3 files changed, 34 insertions(+), 16 deletions(-)
> 
> diff --git a/libavfilter/transform.c b/libavfilter/transform.c
> index f92fc4d42f..f65de965cd 100644
> --- a/libavfilter/transform.c
> +++ b/libavfilter/transform.c
> @@ -103,12 +103,19 @@ INTERPOLATE_METHOD(interpolate_biquadratic)
>  }
>  }
>  
> -void avfilter_get_matrix(float x_shift, float y_shift, float angle, float 
> zoom, float *matrix) {
> -matrix[0] = zoom * cos(angle);
> +void avfilter_get_matrix(
> +float x_shift,
> +float y_shift,
> +float angle,
> +float scale_x,
> +float scale_y,
> +float *matrix
> +) {
> +matrix[0] = scale_x * cos(angle);
>  matrix[1] = -sin(angle);
>  matrix[2] = x_shift;
>  matrix[3] = -matrix[1];
> -matrix[4] = matrix[0];
> +matrix[4] = scale_y * cos(angle);
>  matrix[5] = y_shift;
>  matrix[6] = 0;
>  matrix[7] = 0;
> diff --git a/libavfilter/transform.h b/libavfilter/transform.h
> index 07436bfccb..0bdc9be123 100644
> --- a/libavfilter/transform.h
> +++ b/libavfilter/transform.h
> @@ -60,20 +60,28 @@ enum FillMethod {
>  #define FILL_DEFAULT FILL_ORIGINAL
>  
>  /**
> - * Get an affine transformation matrix from a given translation, rotation, 
> and
> - * zoom factor. The matrix will look like:
> + * Get an affine transformation matrix from given translation, rotation, and
> + * zoom factors. The matrix will look like:
>   *
> - * [ zoom * cos(angle),   -sin(angle), x_shift,
> - *  sin(angle), zoom * cos(angle), y_shift,
> - *   0, 0,   1 ]
> + * [ scale_x * cos(angle),   -sin(angle), x_shift,
> + * sin(angle),  scale_y * cos(angle), y_shift,
> + *  0, 0,   1 ]
>   *
> - * @param x_shift horizontal translation
> - * @param y_shift vertical translation
> - * @param angle   rotation in radians
> - * @param zoomscale percent (1.0 = 100%)
> - * @param matrix  9-item affine transformation matrix
> + * @param x_shift   horizontal translation
> + * @param y_shift   vertical translation
> + * @param angle rotation in radians
> + * @param scale_x   x scale percent (1.0 = 100%)
> + * @param scale_y   y scale percent (1.0 = 100%)
> + * @param matrix9-item affine transformation matrix
>   */
> -void avfilter_get_matrix(float x_shift, float y_shift, float angle, float 
> zoom, float *matrix);
> +void avfilter_get_matrix(
> +float x_shift,
> +float y_shift,
> +float angle,
> +float scale_x,
> +float scale_y,
> +float *matrix
> +);

Apologies for not noticing this when we talked about it earlier, but this 
function is actually user-visible - it's global with an exported prefix 
().
  That means the API/ABI is fixed and you shouldn't be changing the signature.

You could make a new function (with ff_ prefix, I guess?), or just inline the 
code in your own filter.

Thanks,

- Mark


(I'm not sure /why/ it's exported.  A bit of searching doesn't find any code 
which uses it other than the existing deshake filter, so maybe it doesn't need 
to be part of the user API?)
___
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/aacdec: resync to the next aac sample on invalid data instead of aborting

2019-07-20 Thread James Almer
Should fix ticket #6634

Signed-off-by: James Almer 
---
 libavformat/aacdec.c | 44 +---
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index 8a5450880b..5b00b3f664 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -80,10 +80,31 @@ static int adts_aac_probe(const AVProbeData *p)
 return 0;
 }
 
+static int adts_aac_resync(AVFormatContext *s)
+{
+uint16_t state;
+
+// skip data until an ADTS frame is found
+state = avio_r8(s->pb);
+while (!avio_feof(s->pb) && avio_tell(s->pb) < s->probesize) {
+state = (state << 8) | avio_r8(s->pb);
+if ((state >> 4) != 0xFFF)
+continue;
+avio_seek(s->pb, -2, SEEK_CUR);
+break;
+}
+if (s->pb->eof_reached)
+return AVERROR_EOF;
+if ((state >> 4) != 0xFFF)
+return AVERROR_INVALIDDATA;
+
+return 0;
+}
+
 static int adts_aac_read_header(AVFormatContext *s)
 {
 AVStream *st;
-uint16_t state;
+int ret;
 
 st = avformat_new_stream(s, NULL);
 if (!st)
@@ -101,17 +122,9 @@ static int adts_aac_read_header(AVFormatContext *s)
 avio_seek(s->pb, cur, SEEK_SET);
 }
 
-// skip data until the first ADTS frame is found
-state = avio_r8(s->pb);
-while (!avio_feof(s->pb) && avio_tell(s->pb) < s->probesize) {
-state = (state << 8) | avio_r8(s->pb);
-if ((state >> 4) != 0xFFF)
-continue;
-avio_seek(s->pb, -2, SEEK_CUR);
-break;
-}
-if ((state >> 4) != 0xFFF)
-return AVERROR_INVALIDDATA;
+ret = adts_aac_resync(s);
+if (ret < 0)
+return ret;
 
 // LCM of all possible ADTS sample rates
 avpriv_set_pts_info(st, 64, 1, 28224000);
@@ -177,9 +190,10 @@ retry:
 }
 if (!ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) {
 av_packet_unref(pkt);
-return AVERROR_INVALIDDATA;
-}
-ret = handle_id3(s, pkt);
+ret = adts_aac_resync(s);
+} else
+ret = handle_id3(s, pkt);
+
 if (ret < 0)
 return ret;
 
-- 
2.22.0

___
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 3/6] avcodec/ffwavesynth: use uint32_t to compute difference, it is enough

2019-07-20 Thread Nicolas George
Nicolas George (12019-07-19):
> Sorry, I thought I missed the spot and you already applied it.
> 
> This patch could be merged with this one:
> 
> avcodec/ffwavesynth: More correct cast in wavesynth_seek()
> 
> but it is not very important.
> 
> As for:
> 
> avcodec/ffwavesynth: Fix backward lcg_seek()
> avcodec/ffwavesynth: Simplify lcg_seek(), avoid negative case
> 
> If you checked they generate the same sequence, then ok and thanks. If
> not, then I can do the testing tomorrow.

I tested with the following testing code, and the new version behaves
perfectly.

I do not believe this requires including the test program as part of the
code base. It would have been if somebody had not had the bad idea of
removing the possibility of having just "#if TEST \n int main() {...}"
for quick tests.

Regards,

-- 
  Nicolas George


#include 
#include 
#include 
#include 

#define N 1000
static uint32_t val[N];

int
main(void)
{
uint32_t state = 'P' | ('I' << 8) | ('N' << 16) | ('K' << 24);
unsigned i, pos, target;
int64_t off;

for (i = 0; i < N; i++) {
val[i] = state;
state = lcg_next(&state);
}
printf("final state = %08x\n", (unsigned)state);
pos = 0;
state = val[pos];
for (i = 0; i < 1; i++) {
target = val[pos] % N;
off = (int64_t)target - (int64_t)pos;
lcg_seek(&state, off);
printf("seeking from %10d to %10d by %10"PRId64": %08x vs %08x\n",
pos, target, off, (unsigned)state, (unsigned)val[target]);
if (state != val[target])
exit(1);
pos = target;
}
return 0;
}


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 3/3] lavfi: add deshake_opencl filter

2019-07-20 Thread Michael Niedermayer
On Fri, Jul 19, 2019 at 07:19:17PM -0400, Jarek Samic wrote:
> This filter is the subject of my GSoC project.
> 
> This is a video stabilization / deshake filter (name undetermined, feel free 
> to discuss) that uses feature
> point matching and RANSAC to determine a camera path, smooths the camera path 
> with a gaussian filter, and
> then applies the new path to the video.
> 
> There are a number of debug features that can be turned on (viewing point 
> matches, viewing transform
> details, viewing average kernel execution times). See the bottom of the file.
> 
> The filter is finished feature-wise and therefore ready for some review. 
> There are a few things left for
> me to do before this can be merged, though:
> 
> * Improve performance of the OpenCL kernels (in particular: harris_response 
> and match_descriptors)
> * See what I can do to improve the RANSAC model generation to reduce the 
> amount of jitter in the result
> * Clean up the few remaining TODOs
> 
> Just keep that in mind.
> 
> ---
>  libavfilter/Makefile|2 +
>  libavfilter/allfilters.c|1 +
>  libavfilter/opencl/deshake.cl   |  621 ++
>  libavfilter/opencl_source.h |1 +
>  libavfilter/vf_deshake_opencl.c | 1992 +++
>  5 files changed, 2617 insertions(+)
>  create mode 100644 libavfilter/opencl/deshake.cl
>  create mode 100644 libavfilter/vf_deshake_opencl.c

breaks build
make
LD  ffmpeg_g
libavfilter/libavfilter.a(vf_deshake_opencl.o): In function 
`queue_frame.isra.4':
vf_deshake_opencl.c:(.text+0x335): undefined reference to `clSetKernelArg'
vf_deshake_opencl.c:(.text+0x36a): undefined reference to `clSetKernelArg'
vf_deshake_opencl.c:(.text+0x3a0): undefined reference to `clFinish'
vf_deshake_opencl.c:(.text+0x3fc): undefined reference to `clSetKernelArg'
vf_deshake_opencl.c:(.text+0x425): undefined reference to `clSetKernelArg'
vf_deshake_opencl.c:(.text+0x474): undefined reference to 
`clEnqueueNDRangeKernel'
...

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

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



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/mux: correct error msg for when BSF filtering fails

2019-07-20 Thread Gyan



On 16-07-2019 06:11 PM, Gyan wrote:



___
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".


Will push.

Gyan
___
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] avcodec/dvbsubdec: Use ff_set_dimensions()

2019-07-20 Thread Paul B Mahol
On 7/20/19, Michael Niedermayer  wrote:
> Fixes: signed integer overflow: 65313 * 65313 cannot be represented in type
> 'int'
> Fixes:
> 15740/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-5641749164195840
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/dvbsubdec.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> index bc4a17bde0..6e7e13b6eb 100644
> --- a/libavcodec/dvbsubdec.c
> +++ b/libavcodec/dvbsubdec.c
> @@ -1578,8 +1578,9 @@ static int
> dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
>  display_def->width   = bytestream_get_be16(&buf) + 1;
>  display_def->height  = bytestream_get_be16(&buf) + 1;
>  if (!avctx->width || !avctx->height) {
> -avctx->width  = display_def->width;
> -avctx->height = display_def->height;
> +int ret = ff_set_dimensions(avctx, display_def->width,
> display_def->height);
> +if (ret < 0)
> +return ret;
>  }
>
>  if (info_byte & 1<<3) { // display_window_flag
> --
> 2.22.0
>

LGTM

> ___
> 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 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] fftools/ffprobe: process show_frame/show_packets last

2019-07-20 Thread Michael Niedermayer
On Thu, Jul 18, 2019 at 03:55:11PM -0700, Aman Gupta wrote:
> From: Aman Gupta 
> 
> When using `ffprobe -show_format -show_streams -show_packets`,
> it makes more sense to omit static data about the file format
> and streams before the long list of packets instead of at the
> end.
> 
> Signed-off-by: Aman Gupta 
> ---
>  fftools/ffprobe.c | 38 --
>  1 file changed, 20 insertions(+), 18 deletions(-)

breaks fate-ffprobe_compact

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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, v3] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

2019-07-20 Thread Nicolas George
Gyan (12019-07-20):
> From the patch,

After checking, you are right. When that option is enabled, the filter
graphs are still reinited. That makes it slightly less fragile than I
thought.

Regards,

-- 
  Nicolas George


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, v3] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

2019-07-20 Thread Gyan



On 20-07-2019 01:16 PM, Nicolas George wrote:

Gyan (12019-07-20):

Since the auto scaling happens at the end of the graph

Are you sure? IIRC, the scaling happens just after buffersrc.


From the patch,

1)

>  @@ -469,7 +469,7 @@ static int 
configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,

>   if (ret < 0)
>   return ret;
>
>  -    if (ofilter->width || ofilter->height) {
>  +    if ((ofilter->width || ofilter->height) && fg->autoscale) {

and

2)


+{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC |
+  OPT_EXPERT | OPT_INPUT,  
  { .off = OFFSET(autoscale) },
+"automatically insert a scale filter at the end of the filter graph if a 
resolution"




Gyan

___
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] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

2019-07-20 Thread Nicolas George
Gyan (12019-07-20):
> Since the auto scaling happens at the end of the graph

Are you sure? IIRC, the scaling happens just after buffersrc.

Regards,

-- 
  Nicolas George


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 1/3] avcodec/ffwavesynth: Check sample rate before use

2019-07-20 Thread Michael Niedermayer
On Fri, Jul 19, 2019 at 02:54:15PM +0200, Nicolas George wrote:
> Michael Niedermayer (12019-07-15):
> > Fixes: division by zero
> > Fixes: 
> > 15725/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5641231956180992
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/ffwavesynth.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> All three patches look good to me. Thanks for fixing it.

will apply

thanks

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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".