[FFmpeg-cvslog] avcodec/alsdec: Check bits left before block decoding in non multi channel coding loop

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Oct 29 18:47:34 2022 +0200| [1dc8d82da910972d308aebc1ee722044f83b9ccc] | 
committer: Michael Niedermayer

avcodec/alsdec: Check bits left before block decoding in non multi channel 
coding loop

Fixes: Timeout
Fixes: 
52161/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-6440216563154944

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

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

 libavcodec/alsdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index eab382e74f..4605b2248f 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1660,7 +1660,8 @@ static int read_frame_data(ALSDecContext *ctx, unsigned 
int ra_frame)
 
 if (!sconf->mc_coding || ctx->js_switch) {
 int independent_bs = !sconf->joint_stereo;
-
+if (get_bits_left(gb) < 7*channels*ctx->num_blocks)
+return AVERROR_INVALIDDATA;
 for (c = 0; c < channels; c++) {
 js_blocks[0] = 0;
 js_blocks[1] = 0;

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

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


[FFmpeg-cvslog] swscale/output: Bias 16bps output calculations to improve non overflowing range for GBRP16/GBRPF32

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Nov  2 20:00:38 2022 +0100| [b74f89caaef2174b0bfb2791ea88e44960dba11f] | 
committer: Michael Niedermayer

swscale/output: Bias 16bps output calculations to improve non overflowing range 
for GBRP16/GBRPF32

Fixes: integer overflow
Signed-off-by: Michael Niedermayer 

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

 libswscale/output.c   | 25 +++--
 libswscale/x86/output.asm | 16 +++-
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index df4647adde..5c85bff971 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2372,18 +2372,15 @@ yuv2gbrp16_full_X_c(SwsContext *c, const int16_t 
*lumFilter,
 
 Y -= c->yuv2rgb_y_offset;
 Y *= c->yuv2rgb_y_coeff;
-Y += 1 << 13;
+Y += (1 << 13) - (1 << 29);
 R = V * c->yuv2rgb_v2r_coeff;
 G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
 B =U * c->yuv2rgb_u2b_coeff;
 
-R = av_clip_uintp2(Y + R, 30);
-G = av_clip_uintp2(Y + G, 30);
-B = av_clip_uintp2(Y + B, 30);
+dest16[2][i] = av_clip_uintp2(((Y + R) >> 14) + (1<<15), 16);
+dest16[0][i] = av_clip_uintp2(((Y + G) >> 14) + (1<<15), 16);
+dest16[1][i] = av_clip_uintp2(((Y + B) >> 14) + (1<<15), 16);
 
-dest16[0][i] = G >> 14;
-dest16[1][i] = B >> 14;
-dest16[2][i] = R >> 14;
 if (hasAlpha)
 dest16[3][i] = av_clip_uintp2(A, 30) >> 14;
 }
@@ -2448,18 +2445,18 @@ yuv2gbrpf32_full_X_c(SwsContext *c, const int16_t 
*lumFilter,
 
 Y -= c->yuv2rgb_y_offset;
 Y *= c->yuv2rgb_y_coeff;
-Y += 1 << 13;
+Y += (1 << 13) - (1 << 29);
 R = V * c->yuv2rgb_v2r_coeff;
 G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
 B =U * c->yuv2rgb_u2b_coeff;
 
-R = av_clip_uintp2(Y + R, 30);
-G = av_clip_uintp2(Y + G, 30);
-B = av_clip_uintp2(Y + B, 30);
+R = av_clip_uintp2(((Y + R) >> 14) + (1<<15), 16);
+G = av_clip_uintp2(((Y + G) >> 14) + (1<<15), 16);
+B = av_clip_uintp2(((Y + B) >> 14) + (1<<15), 16);
 
-dest32[0][i] = av_float2int(float_mult * (float)(G >> 14));
-dest32[1][i] = av_float2int(float_mult * (float)(B >> 14));
-dest32[2][i] = av_float2int(float_mult * (float)(R >> 14));
+dest32[0][i] = av_float2int(float_mult * (float)G);
+dest32[1][i] = av_float2int(float_mult * (float)B);
+dest32[2][i] = av_float2int(float_mult * (float)R);
 if (hasAlpha)
 dest32[3][i] = av_float2int(float_mult * (float)(av_clip_uintp2(A, 
30) >> 14));
 }
diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
index 84e94baaf6..f943a27534 100644
--- a/libswscale/x86/output.asm
+++ b/libswscale/x86/output.asm
@@ -44,11 +44,13 @@ pd_yuv2gbrp_y_start:   times 8 dd  (1 << 9)
 pd_yuv2gbrp_uv_start:  times 8 dd  ((1 << 9) - (128 << 19))
 pd_yuv2gbrp_a_start:   times 8 dd  (1 << 18)
 pd_yuv2gbrp16_offset:  times 8 dd  0x1  ;(1 << 16)
-pd_yuv2gbrp16_round13: times 8 dd  0x02000  ;(1 << 13)
+pd_yuv2gbrp16_round13: times 8 dd  0xE0002000  ;(1 << 13) - (1 << 29)
 pd_yuv2gbrp16_a_offset:times 8 dd  0x20002000
 pd_yuv2gbrp16_upper30: times 8 dd  0x3FFF ;(1<<30) - 1
 pd_yuv2gbrp16_upper27: times 8 dd  0x07FF ;(1<<27) - 1
+pd_yuv2gbrp16_upper16: times 8 dd  0x ;(1<<16) - 1
 pd_yuv2gbrp16_upperC:  times 8 dd  0xC000
+pd_yuv2gbrp_debias:times 8 dd  0x8000 ;(1 << 29 - 14)
 pb_pack_shuffle8:   db  0,  4,  8, 12, \
-1, -1, -1, -1, \
-1, -1, -1, -1, \
@@ -883,14 +885,26 @@ cglobal yuv2%1_full_X, 12, 14, 16, ptr, lumFilter, 
lumSrcx, lumFilterSize, chrFi
 paddd G, Y
 paddd B, Y
 
+%if  DEPTH < 16
 CLIPP2 R, 30
 CLIPP2 G, 30
 CLIPP2 B, 30
+%endif
 
 psrad R, RGB_SHIFT
 psrad G, RGB_SHIFT
 psrad B, RGB_SHIFT
 
+%if  DEPTH >= 16
+paddd R, [pd_yuv2gbrp_debias]
+paddd G, [pd_yuv2gbrp_debias]
+paddd B, [pd_yuv2gbrp_debias]
+
+CLIPP2 R, 16
+CLIPP2 G, 16
+CLIPP2 B, 16
+%endif
+
 %if FLOAT
 cvtdq2ps R, R
 cvtdq2ps G, G

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

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


[FFmpeg-cvslog] avcodec/alsdec: The minimal block is at least 7 bits

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Oct 29 18:41:24 2022 +0200| [5280947fb6db37063334eae5b467cecd2417b063] | 
committer: Michael Niedermayer

avcodec/alsdec: The minimal block is at least 7 bits

Signed-off-by: Michael Niedermayer 

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

 libavcodec/alsdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 17937ad928..eab382e74f 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1028,7 +1028,7 @@ static int read_block(ALSDecContext *ctx, ALSBlockData 
*bd)
 
 *bd->shift_lsbs = 0;
 
-if (get_bits_left(gb) < 1)
+if (get_bits_left(gb) < 7)
 return AVERROR_INVALIDDATA;
 
 // read block type flag and read the samples accordingly

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

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


[FFmpeg-cvslog] avformat/replaygain: avoid undefined / negative abs

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct 28 23:28:59 2022 +0200| [2532b20b17ec557f1b925bfc41c00e7d4e17356c] | 
committer: Michael Niedermayer

avformat/replaygain: avoid undefined / negative abs

Fixes: signed integer overflow: -2147483648 * 10 cannot be represented in 
type 'int'
Fixes: 
52060/clusterfuzz-testcase-minimized-ffmpeg_dem_MP3_fuzzer-5131616708329472

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavformat/replaygain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/replaygain.c b/libavformat/replaygain.c
index 24f5c74183..915bcb2382 100644
--- a/libavformat/replaygain.c
+++ b/libavformat/replaygain.c
@@ -60,7 +60,7 @@ static int32_t parse_value(const char *value, int32_t min)
 }
 }
 
-if (abs(db) > (INT32_MAX - mb) / 10)
+if (llabs(db) > (INT32_MAX - mb) / 10)
 return min;
 
 return db * 10 + sign * mb;

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

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


[FFmpeg-cvslog] swscale/output: Bias 16bps output calculations to improve non overflowing range

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Nov  2 20:00:38 2022 +0100| [0f0afc7fb5d30c40108d81b320823d8f5c9fbedc] | 
committer: Michael Niedermayer

swscale/output: Bias 16bps output calculations to improve non overflowing range

Fixes: integer overflow
Fixes: ./ffmpeg   -f rawvideo -video_size 66x64 -pixel_format yuva420p10le   -i 
~/videos/overflow_input_w66h64.yuva420p10le   -filter_complex 
"scale=flags=bicubic+full_chroma_int+full_chroma_inp+bitexact+accurate_rnd:in_color_matrix=bt2020:out_color_matrix=bt2020:in_range=full:out_range=full,format=rgba64[out]"
   -pixel_format rgba64 -map '[out]'   -y overflow_w66h64.png

Found-by: Drew Dunne 
Tested-by: Drew Dunne 
Signed-off-by: Michael Niedermayer 

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

 libswscale/output.c | 120 ++--
 1 file changed, 60 insertions(+), 60 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 0e1c1225a0..df4647adde 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1100,8 +1100,8 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t 
*lumFilter,
 Y2 -= c->yuv2rgb_y_offset;
 Y1 *= c->yuv2rgb_y_coeff;
 Y2 *= c->yuv2rgb_y_coeff;
-Y1 += 1 << 13; // 21
-Y2 += 1 << 13;
+Y1 += (1 << 13) - (1 << 29); // 21
+Y2 += (1 << 13) - (1 << 29);
 // 8 bits: 17 + 13 bits = 30 bits, 16 bits: 17 + 13 bits = 30 bits
 
 R = V * c->yuv2rgb_v2r_coeff;
@@ -1109,20 +1109,20 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t 
*lumFilter,
 B =U * c->yuv2rgb_u2b_coeff;
 
 // 8 bits: 30 - 22 = 8 bits, 16 bits: 30 bits - 14 = 16 bits
-output_pixel([0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-output_pixel([1], av_clip_uintp2(  G + Y1, 30) >> 14);
-output_pixel([2], av_clip_uintp2(B_R + Y1, 30) >> 14);
+output_pixel([0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 
16));
+output_pixel([1], av_clip_uintp2(((  G + Y1) >> 14) + (1<<15), 
16));
+output_pixel([2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 
16));
 if (eightbytes) {
 output_pixel([3], av_clip_uintp2(A1  , 30) >> 14);
-output_pixel([4], av_clip_uintp2(R_B + Y2, 30) >> 14);
-output_pixel([5], av_clip_uintp2(  G + Y2, 30) >> 14);
-output_pixel([6], av_clip_uintp2(B_R + Y2, 30) >> 14);
+output_pixel([4], av_clip_uintp2(((R_B + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([5], av_clip_uintp2(((  G + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([6], av_clip_uintp2(((B_R + Y2) >> 14) + 
(1<<15), 16));
 output_pixel([7], av_clip_uintp2(A2  , 30) >> 14);
 dest += 8;
 } else {
-output_pixel([3], av_clip_uintp2(R_B + Y2, 30) >> 14);
-output_pixel([4], av_clip_uintp2(  G + Y2, 30) >> 14);
-output_pixel([5], av_clip_uintp2(B_R + Y2, 30) >> 14);
+output_pixel([3], av_clip_uintp2(((R_B + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([4], av_clip_uintp2(((  G + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([5], av_clip_uintp2(((B_R + Y2) >> 14) + 
(1<<15), 16));
 dest += 6;
 }
 }
@@ -1160,8 +1160,8 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t 
*buf[2],
 Y2 -= c->yuv2rgb_y_offset;
 Y1 *= c->yuv2rgb_y_coeff;
 Y2 *= c->yuv2rgb_y_coeff;
-Y1 += 1 << 13;
-Y2 += 1 << 13;
+Y1 += (1 << 13) - (1 << 29);
+Y2 += (1 << 13) - (1 << 29);
 
 R = V * c->yuv2rgb_v2r_coeff;
 G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
@@ -1175,20 +1175,20 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t 
*buf[2],
 A2 += 1 << 13;
 }
 
-output_pixel([0], av_clip_uintp2(R_B + Y1, 30) >> 14);
-output_pixel([1], av_clip_uintp2(  G + Y1, 30) >> 14);
-output_pixel([2], av_clip_uintp2(B_R + Y1, 30) >> 14);
+output_pixel([0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 
16));
+output_pixel([1], av_clip_uintp2(((  G + Y1) >> 14) + (1<<15), 
16));
+output_pixel([2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 
16));
 if (eightbytes) {
 output_pixel([3], av_clip_uintp2(A1  , 30) >> 14);
-output_pixel([4], av_clip_uintp2(R_B + Y2, 30) >> 14);
-output_pixel([5], av_clip_uintp2(  G + Y2, 30) >> 14);
-output_pixel([6], av_clip_uintp2(B_R + Y2, 30) >> 14);
+output_pixel([4], av_clip_uintp2(((R_B + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([5], av_clip_uintp2(((  G + Y2) >> 14) + 
(1<<15), 16));
+output_pixel([6], av_clip_uintp2(((B_R + Y2) >> 14) + 
(1<<15), 16));
 output_pixel([7], av_clip_uintp2(A2  , 30) >> 14);
 dest += 8;
 } else 

[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 5c52853 web/download: Add FFmpeg 5.0.2

2022-11-04 Thread ffmpeg-git
The branch, master has been updated
   via  5c52853ae8867e2aad1a9f8256bfc0e00302e363 (commit)
  from  cbb14146b09c151049226b4f19e88cd36a398174 (commit)


- Log -
commit 5c52853ae8867e2aad1a9f8256bfc0e00302e363
Author: Michael Niedermayer 
AuthorDate: Fri Nov 4 21:38:40 2022 +0100
Commit: Michael Niedermayer 
CommitDate: Fri Nov 4 21:38:40 2022 +0100

web/download: Add FFmpeg 5.0.2

diff --git a/src/download b/src/download
index ac684d9..7d7fc6d 100644
--- a/src/download
+++ b/src/download
@@ -340,10 +340,10 @@ libpostproc56.  6.100
  

 
-  FFmpeg 5.0.1 "Lorentz"
+  FFmpeg 5.0.2 "Lorentz"
 
   
-5.0.1 was released on 2022-04-04. It is the latest stable FFmpeg release
+5.0.2 was released on 2022-11-04. It is the latest stable FFmpeg release
 from the 5.0 release branch, which was cut from master on 2022-01-04.
   
   It includes the following library versions:
@@ -359,19 +359,19 @@ libswresample   4.  3.100
 libpostproc56.  3.100
   
 
-  Download 
xz tarball
-  PGP 
signature
+  Download 
xz tarball
+  PGP 
signature
  
 
-  Download 
bzip2 tarball
-  PGP 
signature
+  Download 
bzip2 tarball
+  PGP 
signature
  
 
-  Download 
gzip tarball
-  PGP 
signature
+  Download 
gzip tarball
+  PGP 
signature
  
 
-  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n5.0.1;>Changelog
+  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n5.0.2;>Changelog
   https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/5.0:/RELEASE_NOTES;>Release
 Notes
  


---

Summary of changes:
 src/download | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)


hooks/post-receive
-- 

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

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


[FFmpeg-cvslog] Tag n5.0.2 : FFmpeg 5.0.2 release

2022-11-04 Thread git
[ffmpeg] [branch: refs/tags/n5.0.2]
Tag:6fe5148bb859028291af772c4d74f58dcae019e5
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=6fe5148bb859028291af772c4d74f58dcae019e5

Tagger: Michael Niedermayer 
Date:   Fri Nov  4 21:25:00 2022 +0100

FFmpeg 5.0.2 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

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


[FFmpeg-cvslog] Changelog: update

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Fri Nov  4 21:19:58 2022 +0100| [2f428de9ebdcd0770de37d874871b25325aebd73] | 
committer: Michael Niedermayer

Changelog: update

Signed-off-by: Michael Niedermayer 

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

 Changelog | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Changelog b/Changelog
index b2494eea76..5e8d87e512 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,11 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 5.0.2:
+- swscale: aarch64: Fix yuv2rgb with negative strides
+- avcodec/atrac3plusdec: fix compilation failure after last commit
+- avcodec/atrac3plus: reorder channels to match the output layout
+- avcodec/aacdec: fix parsing streams with channel configuration 11
+- Changelog: update
 - avcodec/speexdec: Check channels > 2
 - avformat/vividas: Check packet size
 - avcodec/dstdec: Check for overflow in build_filter()

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

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


[FFmpeg-cvslog] avutil/tests/cpu: print the avx512icl flag

2022-11-04 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Oct 26 17:40:03 
2022 +0200| [0f252dfa95568f87f87ed47b63ea8ea091e76048] | committer: James 
Darnley

avutil/tests/cpu: print the avx512icl flag

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

 libavutil/tests/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
index 5bec742b2b..dadadb31dc 100644
--- a/libavutil/tests/cpu.c
+++ b/libavutil/tests/cpu.c
@@ -77,6 +77,7 @@ static const struct {
 { AV_CPU_FLAG_BMI2,  "bmi2"   },
 { AV_CPU_FLAG_AESNI, "aesni"  },
 { AV_CPU_FLAG_AVX512,"avx512" },
+{ AV_CPU_FLAG_AVX512ICL, "avx512icl"  },
 { AV_CPU_FLAG_SLOW_GATHER, "slowgather" },
 #elif ARCH_LOONGARCH
 { AV_CPU_FLAG_LSX,   "lsx"},

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

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


[FFmpeg-cvslog] avcodec/v210enc: add new function for avx2 avx512 avx512icl

2022-11-04 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Tue Oct 25 16:27:38 
2022 +0200| [c3d36e1b3de1e2b8a84f47d0369dcea41c8cd351] | committer: James 
Darnley

avcodec/v210enc: add new function for avx2 avx512 avx512icl

Negligible speed difference for avx2 on Zen 2 (Ryzen 5700X) and
Broadwell (Xeon E5-2620 v4):
1690±4.3 decicycles vs. 1693±78.4
1439±31.1 decicycles vs 1429±16.7

Moderate speedup with avx512 on Skylake-X (Xeon D-2123IT):
1.22x faster (793±0.8 vs. 649±5.5 decicycles) compared with avx2

Better speedup with avx512icl on Ice Lake (Xeon Silver 4316):
1.77x faster (784±1.8 vs. 442±11.6 decicycles) compared with avx2

Co-authors:
Henrik Gramner 
Kieran Kunhya 

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

 libavcodec/x86/v210enc.asm| 80 +--
 libavcodec/x86/v210enc_init.c | 14 
 2 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/libavcodec/x86/v210enc.asm b/libavcodec/x86/v210enc.asm
index 965f2bea3c..afac238ede 100644
--- a/libavcodec/x86/v210enc.asm
+++ b/libavcodec/x86/v210enc.asm
@@ -21,7 +21,7 @@
 
 %include "libavutil/x86/x86util.asm"
 
-SECTION_RODATA 32
+SECTION_RODATA 64
 
 cextern pw_4
 %define v210_enc_min_10 pw_4
@@ -46,6 +46,16 @@ v210_enc_chroma_shuf2_8: times 2 db 
3,-1,4,-1,5,-1,7,-1,11,-1,12,-1,13,-1,15,-1
 
 v210_enc_chroma_mult_8: times 2 dw 4,16,64,0,64,4,16,0
 
+v210enc_8_permb: db 32, 0,48,-1 ,  1,33, 2,-1 , 49, 3,34,-1 ,  4,50, 5,-1
+ db 35, 6,51,-1 ,  7,36, 8,-1 , 52, 9,37,-1 , 10,53,11,-1
+ db 38,12,54,-1 , 13,39,14,-1 , 55,15,40,-1 , 16,56,17,-1
+ db 41,18,57,-1 , 19,42,20,-1 , 58,21,43,-1 , 22,59,23,-1
+v210enc_8_shufb: db  0, 8, 1,-1 ,  9, 2,10,-1 ,  3,11, 4,-1 , 12, 5,13,-1
+ db  2,10, 3,-1 , 11, 4,12,-1 ,  5,13, 6,-1 , 14, 7,15,-1
+v210enc_8_permd: dd 0,1,4,5, 1,2,5,6
+v210enc_8_mult: db 4, 0, 64, 0
+v210enc_8_mask: dd 255<<12
+
 SECTION .text
 
 %macro v210_planar_pack_10 0
@@ -178,7 +188,73 @@ INIT_XMM avx
 v210_planar_pack_8
 %endif
 
+%macro v210_planar_pack_8_new 0
+
+cglobal v210_planar_pack_8, 5, 5, 7+notcpuflag(avx512icl), y, u, v, dst, width
+add yq, widthq
+shr widthq, 1
+add uq, widthq
+add vq, widthq
+neg widthq
+
+%if cpuflag(avx512icl)
+mova m2, [v210enc_8_permb]
+%else
+mova m2, [v210enc_8_permd]
+%endif
+vpbroadcastd   m3, [v210enc_8_mult]
+VBROADCASTI128 m4, [v210_enc_min_8] ; only ymm sized
+VBROADCASTI128 m5, [v210_enc_max_8] ; only ymm sized
+vpbroadcastd   m6, [v210enc_8_mask]
+%if notcpuflag(avx512icl)
+movu m7, [v210enc_8_shufb]
+%endif
+
+.loop:
+%if cpuflag(avx512icl)
+movu ym1, [yq + 2*widthq]
+vinserti32x4  m1, [uq + 1*widthq], 2
+vinserti32x4  m1, [vq + 1*widthq], 3
+vpermbm1, m2, m1 ; uyv0 yuy0 vyu0 yvy0
+%else
+movq xm0, [uq + 1*widthq];  uuxx
+movq xm1, [vq + 1*widthq];  vvxx
+punpcklbwxm1, xm0, xm1   ; uvuv uvuv uvuv 
+vinserti128   m1, m1, [yq + 2*widthq], 1 ; uvuv uvuv uvuv  
   
+vpermdm1, m2, m1 ; uvuv uvxx  yyxx 
xxuv uvuv xxyy 
+pshufbm1, m7 ; uyv0 yuy0 vyu0 yvy0
+%endif
+CLIPUB   m1, m4, m5
+
+pmaddubsw  m0, m1, m3
+pslld  m1,  4
+%if cpuflag(avx512)
+vpternlogd m0, m1, m6, 0xd8 ; C?B:A
+%else
+pand   m1, m6, m1
+pandn  m0, m6, m0
+porm0, m0, m1
+%endif
+
+movu  [dstq], m0
+add dstq, mmsize
+add   widthq, (mmsize*3)/16
+jl .loop
+RET
+
+%endmacro
+
 %if HAVE_AVX2_EXTERNAL
 INIT_YMM avx2
-v210_planar_pack_8
+v210_planar_pack_8_new
+%endif
+
+%if HAVE_AVX512_EXTERNAL
+INIT_YMM avx512
+v210_planar_pack_8_new
+%endif
+
+%if HAVE_AVX512ICL_EXTERNAL
+INIT_ZMM avx512icl
+v210_planar_pack_8_new
 %endif
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 13a351dd1d..6e9f8c6e61 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -27,6 +27,10 @@ void ff_v210_planar_pack_8_avx(const uint8_t *y, const 
uint8_t *u,
const uint8_t *v, uint8_t *dst, ptrdiff_t 
width);
 void ff_v210_planar_pack_8_avx2(const uint8_t *y, const uint8_t *u,
 const uint8_t *v, uint8_t *dst, ptrdiff_t 
width);
+void ff_v210_planar_pack_8_avx512(const uint8_t *y, const uint8_t *u,
+const uint8_t *v, uint8_t *dst, ptrdiff_t 
width);
+void ff_v210_planar_pack_8_avx512icl(const uint8_t *y, const uint8_t *u,
+const uint8_t *v, uint8_t 

[FFmpeg-cvslog] checkasm: add a verbose check function for uint32_t data

2022-11-04 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Oct 26 17:51:36 
2022 +0200| [1936c06f029bd0e793aea47767b06e72a497c268] | committer: James 
Darnley

checkasm: add a verbose check function for uint32_t data

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

 tests/checkasm/checkasm.c | 1 +
 tests/checkasm/checkasm.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 421bd096c5..c3d77cb6af 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -918,5 +918,6 @@ int checkasm_check_##type(const char *const file, const int 
line, \
 
 DEF_CHECKASM_CHECK_FUNC(uint8_t,  "%02x")
 DEF_CHECKASM_CHECK_FUNC(uint16_t, "%04x")
+DEF_CHECKASM_CHECK_FUNC(uint32_t, "%08x")
 DEF_CHECKASM_CHECK_FUNC(int16_t,  "%6d")
 DEF_CHECKASM_CHECK_FUNC(int32_t,  "%9d")
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index ee9151410e..5f68115035 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -296,6 +296,7 @@ int checkasm_check_##type(const char *const file, const int 
line, \
 
 DECL_CHECKASM_CHECK_FUNC(uint8_t);
 DECL_CHECKASM_CHECK_FUNC(uint16_t);
+DECL_CHECKASM_CHECK_FUNC(uint32_t);
 DECL_CHECKASM_CHECK_FUNC(int16_t);
 DECL_CHECKASM_CHECK_FUNC(int32_t);
 

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

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


[FFmpeg-cvslog] mailmap: stop git lying about who I commit things as

2022-11-04 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Fri Oct 28 16:04:42 
2022 +0200| [f53c590f3d18799bfb85a383d0738b28fe2fd08e] | committer: James 
Darnley

mailmap: stop git lying about who I commit things as

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

 .mailmap | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index ba072f38c8..af60290f77 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,4 +1,3 @@
- 
  
  
  

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

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


[FFmpeg-cvslog] avfilter/af_dynaudnorm: process also short durations

2022-11-04 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Nov  4 13:35:46 
2022 +0100| [4a672f1c0e660cdb7b3e93f0e830d64e8f819ccb] | committer: Paul B Mahol

avfilter/af_dynaudnorm: process also short durations

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

 libavfilter/af_dynaudnorm.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 9505c33b49..5aecefff5e 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -824,19 +824,13 @@ static int flush(AVFilterLink *outlink)
 AVFilterContext *ctx = outlink->src;
 AVFilterLink *inlink = ctx->inputs[0];
 DynamicAudioNormalizerContext *s = ctx->priv;
-int ret = 0;
 
-if (!cqueue_empty(s->gain_history_smoothed[0])) {
-ret = flush_buffer(s, inlink, outlink);
-} else if (s->queue.available) {
-AVFrame *out = ff_bufqueue_get(>queue);
-
-s->pts = out->pts + av_rescale_q(out->nb_samples, av_make_q(1, 
outlink->sample_rate),
- outlink->time_base);
-ret = ff_filter_frame(outlink, out);
+while (s->eof && cqueue_empty(s->gain_history_smoothed[0])) {
+for (int c = 0; c < s->channels; c++)
+update_gain_history(s, c, (local_gain){ 
cqueue_peek(s->gain_history_original[c], 0), 1.0});
 }
 
-return ret;
+return flush_buffer(s, inlink, outlink);
 }
 
 static int activate(AVFilterContext *ctx)

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

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


[FFmpeg-cvslog] avfilter/af_dynaudnorm: add slice threading support

2022-11-04 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Nov  4 17:59:28 
2022 +0100| [369b7f2654aa200edfac4a4f8a9b4f5d0bfa9517] | committer: Paul B Mahol

avfilter/af_dynaudnorm: add slice threading support

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

 libavfilter/af_dynaudnorm.c | 86 +
 1 file changed, 64 insertions(+), 22 deletions(-)

diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 5aecefff5e..88d1b382f3 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -93,6 +93,11 @@ typedef struct DynamicAudioNormalizerContext {
 AVFrame *window;
 } DynamicAudioNormalizerContext;
 
+typedef struct ThreadData {
+AVFrame *in, *out;
+int enabled;
+} ThreadData;
+
 #define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x)
 #define FLAGS 
AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
@@ -521,6 +526,20 @@ static void 
update_gain_history(DynamicAudioNormalizerContext *s, int channel,
 }
 }
 
+static int update_gain_histories(AVFilterContext *ctx, void *arg, int jobnr, 
int nb_jobs)
+{
+DynamicAudioNormalizerContext *s = ctx->priv;
+AVFrame *analyze_frame = arg;
+const int channels = s->channels;
+const int start = (channels * jobnr) / nb_jobs;
+const int end = (channels * (jobnr+1)) / nb_jobs;
+
+for (int c = start; c < end; c++)
+update_gain_history(s, c, get_max_local_gain(s, analyze_frame, c));
+
+return 0;
+}
+
 static inline double update_value(double new, double old, double 
aggressiveness)
 {
 av_assert0((aggressiveness >= 0.0) && (aggressiveness <= 1.0));
@@ -655,8 +674,9 @@ static void 
perform_compression(DynamicAudioNormalizerContext *s, AVFrame *frame
 }
 }
 
-static int analyze_frame(DynamicAudioNormalizerContext *s, AVFilterLink 
*outlink, AVFrame **frame)
+static int analyze_frame(AVFilterContext *ctx, AVFilterLink *outlink, AVFrame 
**frame)
 {
+DynamicAudioNormalizerContext *s = ctx->priv;
 AVFrame *analyze_frame;
 
 if (s->dc_correction || s->compress_factor > DBL_EPSILON) {
@@ -716,34 +736,49 @@ static int analyze_frame(DynamicAudioNormalizerContext 
*s, AVFilterLink *outlink
 for (int c = 0; c < s->channels; c++)
 update_gain_history(s, c, gain);
 } else {
-for (int c = 0; c < s->channels; c++)
-update_gain_history(s, c, get_max_local_gain(s, analyze_frame, c));
+ff_filter_execute(ctx, update_gain_histories, analyze_frame, NULL,
+  FFMIN(s->channels, ff_filter_get_nb_threads(ctx)));
 }
 
 return 0;
 }
 
-static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *in,
-  AVFrame *frame, int enabled)
+static void amplify_channel(DynamicAudioNormalizerContext *s, AVFrame *in,
+AVFrame *frame, int enabled, int c)
 {
-for (int c = 0; c < s->channels; c++) {
-const int bypass = bypass_channel(s, frame, c);
-const double *src_ptr = (const double *)in->extended_data[c];
-double *dst_ptr = (double *)frame->extended_data[c];
-double current_amplification_factor;
-
-cqueue_dequeue(s->gain_history_smoothed[c], 
_amplification_factor);
+const int bypass = bypass_channel(s, frame, c);
+const double *src_ptr = (const double *)in->extended_data[c];
+double *dst_ptr = (double *)frame->extended_data[c];
+double current_amplification_factor;
 
-for (int i = 0; i < frame->nb_samples && enabled && !bypass; i++) {
-const double amplification_factor = 
fade(s->prev_amplification_factor[c],
- 
current_amplification_factor, i,
- frame->nb_samples);
+cqueue_dequeue(s->gain_history_smoothed[c], _amplification_factor);
 
-dst_ptr[i] = src_ptr[i] * amplification_factor;
-}
+for (int i = 0; i < frame->nb_samples && enabled && !bypass; i++) {
+const double amplification_factor = 
fade(s->prev_amplification_factor[c],
+ current_amplification_factor, 
i,
+ frame->nb_samples);
 
-s->prev_amplification_factor[c] = current_amplification_factor;
+dst_ptr[i] = src_ptr[i] * amplification_factor;
 }
+
+s->prev_amplification_factor[c] = current_amplification_factor;
+}
+
+static int amplify_channels(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+DynamicAudioNormalizerContext *s = ctx->priv;
+ThreadData *td = arg;
+AVFrame *out = td->out;
+AVFrame *in = td->in;
+const int enabled = td->enabled;
+const int channels = s->channels;
+const int start = (channels * jobnr) / nb_jobs;
+const int end = (channels * (jobnr+1)) / nb_jobs;
+
+for (int ch = start; ch < end; 

[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/3.2 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [9c008fdbd43c4a9f2c2ab9acd6a7d223d64fec89] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/3.4 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [244b61e276c71439d02f9a3995a29cf670404d0c] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/4.0 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [cabe77a6fc40048d2ed9511f1d65bd25b5f49fc7] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/4.1 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [a4ba6e7d2c398bf6bccca85c5819b52ec579e89b] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/4.2 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [9d5450b514217b8aca408652d17a2ff00a9ffa51] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/4.3 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [3993a9073255c4897daab504eafdcbbc7bd5a5b1] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa105..10bd1f7480 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -188,8 +188,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/4.4 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [a1f13b592bebd1a9b9ab486969f29b709784f3c0] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index f4b220fb60..f341268c5d 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/5.0 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [7bc6dab675124289a5772974c7cfa38845c7a27a] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index f4b220fb60..f341268c5d 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] swscale: aarch64: Fix yuv2rgb with negative strides

2022-11-04 Thread Martin Storsjö
ffmpeg | branch: release/5.1 | Martin Storsjö  | Tue Oct 25 
13:13:34 2022 +0300| [a6e26053c21362bb882932f3cfd1f1dfa2551f1d] | committer: 
Martin Storsjö

swscale: aarch64: Fix yuv2rgb with negative strides

Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö 
(cherry picked from commit cb803a0072cb98945dcd3f1660bd2a975650ce42)
Signed-off-by: Martin Storsjö 

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

 libswscale/aarch64/yuv2rgb_neon.S | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/aarch64/yuv2rgb_neon.S 
b/libswscale/aarch64/yuv2rgb_neon.S
index f4b220fb60..f341268c5d 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -118,8 +118,8 @@
 .endm
 
 .macro increment_yuv422p
-add x6,  x6,  w7, UXTW  // 
srcU += incU
-add x13, x13, w14, UXTW // 
srcV += incV
+add x6,  x6,  w7, SXTW  // 
srcU += incU
+add x13, x13, w14, SXTW // 
srcV += incV
 .endm
 
 .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
@@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
 st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
 subsw8, w8, #16 // 
width -= 16
 b.gt2b
-add x2, x2, w3, UXTW// dst 
 += padding
-add x4, x4, w5, UXTW// 
srcY += paddingY
+add x2, x2, w3, SXTW// dst 
 += padding
+add x4, x4, w5, SXTW// 
srcY += paddingY
 increment_\ifmt
 subsw1, w1, #1  // 
height -= 1
 b.gt1b

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

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


[FFmpeg-cvslog] avcodec/atrac3plus: reorder channels to match the output layout

2022-11-04 Thread James Almer
ffmpeg | branch: release/5.1 | James Almer  | Mon Oct 31 
17:24:47 2022 -0300| [b4a4a3149911b0dd24b6268a04849673e16ef99f] | committer: 
James Almer

avcodec/atrac3plus: reorder channels to match the output layout

The order in which the channels are coded in the bitstream do not always follow
the native, bitmask-based order of channels both signaled by the WAV container
and forced by this same decoder. This is the case with layouts containing an
LFE channel, as it's always coded last.

Fixes ticket #9964.

Signed-off-by: James Almer 
(cherry picked from commit 3819719099df601c470e961b9d49b9100c65641b)

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

 libavcodec/atrac3plusdec.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c
index f87ffb8938..aef4e36df8 100644
--- a/libavcodec/atrac3plusdec.c
+++ b/libavcodec/atrac3plusdec.c
@@ -48,6 +48,17 @@
 #include "atrac.h"
 #include "atrac3plus.h"
 
+static const uint8_t channel_map[8][8] = {
+{ 0, },
+{ 0, 1, },
+{ 0, 1, 2, },
+{ 0, 1, 2, 3, },
+{ 0, },
+{ 0, 1, 2, 4, 5, 3, },
+{ 0, 1, 2, 4, 5, 6, 3, },
+{ 0, 1, 2, 4, 5, 6, 7, 3, },
+};
+
 typedef struct ATRAC3PContext {
 GetBitContext gb;
 AVFloatDSPContext *fdsp;
@@ -65,6 +76,7 @@ typedef struct ATRAC3PContext {
 
 int num_channel_blocks; ///< number of channel blocks
 uint8_t channel_blocks[5];  ///< channel configuration descriptor
+const uint8_t *channel_map; ///< channel layout map
 } ATRAC3PContext;
 
 static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
@@ -143,6 +155,8 @@ static av_cold int set_channel_params(ATRAC3PContext *ctx,
 return AVERROR_INVALIDDATA;
 }
 
+ctx->channel_map = channel_map[channels - 1];
+
 return 0;
 }
 
@@ -378,7 +392,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
   channels_to_process, avctx);
 
 for (i = 0; i < channels_to_process; i++)
-memcpy(samples_p[out_ch_index + i], ctx->outp_buf[i],
+memcpy(samples_p[ctx->channel_map[out_ch_index + i]], 
ctx->outp_buf[i],
ATRAC3P_FRAME_SAMPLES * sizeof(**samples_p));
 
 ch_block++;

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

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


[FFmpeg-cvslog] avcodec/aacdec: fix parsing streams with channel configuration 11

2022-11-04 Thread James Almer
ffmpeg | branch: release/5.1 | James Almer  | Wed Oct 26 
20:11:04 2022 -0300| [fe2d8f1872ac40d3046c6d104d73c5244e251703] | committer: 
James Almer

avcodec/aacdec: fix parsing streams with channel configuration 11

Set the correct amount of tags in tags_per_config[].
Also, there are no channels that correspond to a side element in this
configuration, so reflect this in the list of known/supported channel layouts.

Signed-off-by: James Almer 
(cherry picked from commit 8c7d3b43cc1e41de62733eb90dda7e061778f390)

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

 libavcodec/aacdec_template.c | 4 +---
 libavcodec/aacdectab.h   | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 10fba3d3b2..7e02f8f8a8 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -730,9 +730,7 @@ static ChannelElement *get_che(AACContext *ac, int type, 
int elem_id)
 return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
 }
 case 11:
-if (ac->tags_mapped == 2 &&
-ac->oc[1].m4ac.chan_config == 11 &&
-type == TYPE_SCE) {
+if (ac->tags_mapped == 3 && type == TYPE_SCE) {
 ac->tags_mapped++;
 return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
 }
diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h
index e03026806d..01fd18cd23 100644
--- a/libavcodec/aacdectab.h
+++ b/libavcodec/aacdectab.h
@@ -35,7 +35,7 @@
 
 #include 
 
-static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 
4, 5, 16, 5, 0 };
+static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 
5, 5, 16, 5, 0 };
 
 static const uint8_t aac_channel_layout_map[16][16][3] = {
 { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
@@ -84,7 +84,7 @@ static const uint64_t aac_channel_layout[16] = {
 0,
 0,
 0,
-AV_CH_LAYOUT_6POINT1,
+AV_CH_LAYOUT_6POINT1_BACK,
 AV_CH_LAYOUT_7POINT1,
 AV_CH_LAYOUT_22POINT2,
 0,
@@ -103,7 +103,7 @@ static const AVChannelLayout aac_ch_layout[16] = {
 { 0 },
 { 0 },
 { 0 },
-AV_CHANNEL_LAYOUT_6POINT1,
+AV_CHANNEL_LAYOUT_6POINT1_BACK,
 AV_CHANNEL_LAYOUT_7POINT1,
 AV_CHANNEL_LAYOUT_22POINT2,
 { 0 },

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

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


[FFmpeg-cvslog] avcodec/atrac3plusdec: fix compilation failure after last commit

2022-11-04 Thread James Almer
ffmpeg | branch: release/5.0 | James Almer  | Fri Nov  4 
09:12:19 2022 -0300| [e2a529bdcacaa9e29a9c7342bb4f3142ab8f6a7d] | committer: 
James Almer

avcodec/atrac3plusdec: fix compilation failure after last commit

Signed-off-by: James Almer 

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

 libavcodec/atrac3plusdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c
index d1287ee8da..f2941299be 100644
--- a/libavcodec/atrac3plusdec.c
+++ b/libavcodec/atrac3plusdec.c
@@ -155,7 +155,7 @@ static av_cold int set_channel_params(ATRAC3PContext *ctx,
 return AVERROR_INVALIDDATA;
 }
 
-ctx->channel_map = channel_map[channels - 1];
+ctx->channel_map = channel_map[avctx->channels - 1];
 
 return 0;
 }

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

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


[FFmpeg-cvslog] avcodec/atrac3plus: reorder channels to match the output layout

2022-11-04 Thread James Almer
ffmpeg | branch: release/5.0 | James Almer  | Mon Oct 31 
17:24:47 2022 -0300| [9a1522173146af40b259400c6d10f348b9518bd4] | committer: 
James Almer

avcodec/atrac3plus: reorder channels to match the output layout

The order in which the channels are coded in the bitstream do not always follow
the native, bitmask-based order of channels both signaled by the WAV container
and forced by this same decoder. This is the case with layouts containing an
LFE channel, as it's always coded last.

Fixes ticket #9964.

Signed-off-by: James Almer 
(cherry picked from commit 3819719099df601c470e961b9d49b9100c65641b)

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

 libavcodec/atrac3plusdec.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c
index e342f09fdb..d1287ee8da 100644
--- a/libavcodec/atrac3plusdec.c
+++ b/libavcodec/atrac3plusdec.c
@@ -47,6 +47,17 @@
 #include "atrac.h"
 #include "atrac3plus.h"
 
+static const uint8_t channel_map[8][8] = {
+{ 0, },
+{ 0, 1, },
+{ 0, 1, 2, },
+{ 0, 1, 2, 3, },
+{ 0, },
+{ 0, 1, 2, 4, 5, 3, },
+{ 0, 1, 2, 4, 5, 6, 3, },
+{ 0, 1, 2, 4, 5, 6, 7, 3, },
+};
+
 typedef struct ATRAC3PContext {
 GetBitContext gb;
 AVFloatDSPContext *fdsp;
@@ -65,6 +76,7 @@ typedef struct ATRAC3PContext {
 int num_channel_blocks; ///< number of channel blocks
 uint8_t channel_blocks[5];  ///< channel configuration descriptor
 uint64_t my_channel_layout; ///< current channel layout
+const uint8_t *channel_map; ///< channel layout map
 } ATRAC3PContext;
 
 static av_cold int atrac3p_decode_close(AVCodecContext *avctx)
@@ -143,6 +155,8 @@ static av_cold int set_channel_params(ATRAC3PContext *ctx,
 return AVERROR_INVALIDDATA;
 }
 
+ctx->channel_map = channel_map[channels - 1];
+
 return 0;
 }
 
@@ -381,7 +395,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void 
*data,
   channels_to_process, avctx);
 
 for (i = 0; i < channels_to_process; i++)
-memcpy(samples_p[out_ch_index + i], ctx->outp_buf[i],
+memcpy(samples_p[ctx->channel_map[out_ch_index + i]], 
ctx->outp_buf[i],
ATRAC3P_FRAME_SAMPLES * sizeof(**samples_p));
 
 ch_block++;

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

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


[FFmpeg-cvslog] avcodec/aacdec: fix parsing streams with channel configuration 11

2022-11-04 Thread James Almer
ffmpeg | branch: release/5.0 | James Almer  | Wed Oct 26 
20:11:04 2022 -0300| [c351fdc0c6bd1a6d7b0d66374607cc64ca6554df] | committer: 
James Almer

avcodec/aacdec: fix parsing streams with channel configuration 11

Set the correct amount of tags in tags_per_config[].
Also, there are no channels that correspond to a side element in this
configuration, so reflect this in the list of known/supported channel layouts.

Signed-off-by: James Almer 
(cherry picked from commit 8c7d3b43cc1e41de62733eb90dda7e061778f390)

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

 libavcodec/aacdec_template.c | 4 +---
 libavcodec/aacdectab.h   | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 7149b331ae..f972f1d590 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -716,9 +716,7 @@ static ChannelElement *get_che(AACContext *ac, int type, 
int elem_id)
 return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
 }
 case 11:
-if (ac->tags_mapped == 2 &&
-ac->oc[1].m4ac.chan_config == 11 &&
-type == TYPE_SCE) {
+if (ac->tags_mapped == 3 && type == TYPE_SCE) {
 ac->tags_mapped++;
 return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
 }
diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h
index c54a3eb943..14851b23e2 100644
--- a/libavcodec/aacdectab.h
+++ b/libavcodec/aacdectab.h
@@ -35,7 +35,7 @@
 
 #include 
 
-static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 
4, 5, 16, 5, 0 };
+static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 
5, 5, 16, 5, 0 };
 
 static const uint8_t aac_channel_layout_map[16][16][3] = {
 { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
@@ -83,7 +83,7 @@ static const uint64_t aac_channel_layout[16] = {
 0,
 0,
 0,
-AV_CH_LAYOUT_6POINT1,
+AV_CH_LAYOUT_6POINT1_BACK,
 AV_CH_LAYOUT_7POINT1,
 AV_CH_LAYOUT_22POINT2,
 0,

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

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


[FFmpeg-cvslog] Changelog: update

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Fri Nov  4 11:07:53 2022 +0100| [1a8defb281ac2d1d04ee1e96e667861cd005dd2d] | 
committer: Michael Niedermayer

Changelog: update

Signed-off-by: Michael Niedermayer 

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

 Changelog | 42 ++
 1 file changed, 42 insertions(+)

diff --git a/Changelog b/Changelog
index f88b70590b..b2494eea76 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,48 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 5.0.2:
+- avcodec/speexdec: Check channels > 2
+- avformat/vividas: Check packet size
+- avcodec/dstdec: Check for overflow in build_filter()
+- avformat/spdifdec: Use 64bit to compute bit rate
+- avformat/rpl: Use 64bit for duration computation
+- avformat/xwma: Use av_rescale() for duration computation
+- avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration 
calculation
+- avformat/sbgdec: Check ts_int in genrate_intervals
+- avformat/sbgdec: clamp end_ts
+- avformat/rmdec: check tag_size
+- avformat/nutdec: Check fields
+- avformat/flvdec: Use 64bit for sum_flv_tag_size
+- avformat/jacosubdec: Fix overflow in get_shift()
+- avformat/dxa: avoid bpc overflows
+- avformat/dhav: Use 64bit seek_back
+- avformat/cafdec: Check that nb_frasmes fits within 64bit
+- avformat/asfdec_o: Limit packet offset
+- avformat/ape: Check frames size
+- avformat/icodec: Check nb_pal
+- avformat/aiffdec: Use 64bit for block_duration use
+- avformat/aiffdec: Check block_duration
+- avformat/mxfdec: only probe max run in
+- avformat/mxfdec: Check run_in is within 65536
+- avcodec/mjpegdec: Check for unsupported bayer case
+- avcodec/apedec: Fix integer overflow in filter_3800()
+- avcodec/tta: Check 24bit scaling for overflow
+- avcodec/mobiclip: Check quantizer for overflow
+- avcodec/exr: Check preview psize
+- avcodec/tiff: Fix loop detection
+- libavformat/hls: Free keys
+- avcodec/fmvc: Move frame allocation to a later stage
+- avfilter/vf_showinfo: remove backspaces
+- avcodec/speedhq: Check width
+- avcodec/bink: disallow odd positioned scaled blocks
+- libswscale: force a minimum size of the slide for bayer sources
+- lavc/videotoolbox: do not pass AVCodecContext to decoder output callback
+- lavc/pthread_frame: always transfer stashed hwaccel state
+- avformat/cafenc: derive Opus frame size from the relevant stream parameters
+- avcodec/arm/sbcenc: avoid callee preserved vfp registers
+- avfilter/vf_scale: overwrite the width and height expressions with the 
original values
+- lavc/pthread_frame: avoid leaving stale hwaccel state in worker threads
+- Update for 5.0.2
 - avformat/asfdec_o: limit recursion depth in asf_read_unknown()
 - doc/git-howto.texi: Document commit signing
 - libavcodec/8bps: Check that line lengths fit within the buffer

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

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


[FFmpeg-cvslog] avcodec/speexdec: Check channels > 2

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Thu Sep 29 23:16:51 2022 +0200| [59fe00912a48aa877b7538a8620e6ecedbdba88c] | 
committer: Michael Niedermayer

avcodec/speexdec: Check channels > 2

More than 2 channels seems unsupported, the code seems to just output empty 
extra channels

Fixes: Timeout
Fixes: 
51569/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-5511509165342720

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 77164b2344eb67d61f973ebbbc8e0b88aaae027b)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/speexdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index ee95417deb..a7adcbfba4 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -1451,7 +1451,7 @@ static av_cold int speex_decode_init(AVCodecContext 
*avctx)
 return AVERROR_INVALIDDATA;
 
 s->nb_channels = avctx->channels;
-if (s->nb_channels <= 0)
+if (s->nb_channels <= 0 || s->nb_channels > 2)
 return AVERROR_INVALIDDATA;
 
 switch (s->rate) {

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

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


[FFmpeg-cvslog] avformat/vividas: Check packet size

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 19:14:07 2022 +0200| [e4c5c904932b2ddc1f2c7b2e38ddf1fdaba09875] | 
committer: Michael Niedermayer

avformat/vividas: Check packet size

Fixes: signed integer overflow: 119760682 - -2084600173 cannot be represented 
in type 'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6745781167587328

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 5f44489cc5d4f3767f6ad2ad067ee6a3f78374bb)
Signed-off-by: Michael Niedermayer 

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

 libavformat/vividas.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index d7a6e74650..2668f93f06 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -682,6 +682,7 @@ static int viv_read_packet(AVFormatContext *s,
 
 if (viv->sb_entries[viv->current_sb_entry].flag == 0) {
 uint64_t v_size = ffio_read_varlen(pb);
+int last = 0, last_start;
 
 if (!viv->num_audio)
 return AVERROR_INVALIDDATA;
@@ -705,12 +706,18 @@ static int viv_read_packet(AVFormatContext *s,
 
 if (i > 0 && start == 0)
 break;
+if (start < last)
+return AVERROR_INVALIDDATA;
 
 viv->n_audio_subpackets = i + 1;
+last =
 viv->audio_subpackets[i].start = start;
 viv->audio_subpackets[i].pcm_bytes = pcm_bytes;
 }
+last_start =
 viv->audio_subpackets[viv->n_audio_subpackets].start = (int)(off - 
avio_tell(pb));
+if (last_start < last)
+return AVERROR_INVALIDDATA;
 viv->current_audio_subpacket = 0;
 
 } else {

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

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


[FFmpeg-cvslog] avcodec/dstdec: Check for overflow in build_filter()

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 10 23:49:28 2022 +0200| [2376a4d5a78d46f45b6171f2a856f01ac80923cb] | 
committer: Michael Niedermayer

avcodec/dstdec: Check for overflow in build_filter()

Fixes: signed integer overflow: 1917019860 + 265558963 cannot be represented in 
type 'int'
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-4833165046317056

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 8008940da5aa43895fd4574114309c3324249eab)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/dstdec.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 6d0b25f4c3..5299c9606f 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -214,7 +214,7 @@ static uint8_t prob_dst_x_bit(int c)
 return (ff_reverse[c & 127] >> 1) + 1;
 }
 
-static void build_filter(int16_t table[DST_MAX_ELEMENTS][16][256], const Table 
*fsets)
+static int build_filter(int16_t table[DST_MAX_ELEMENTS][16][256], const Table 
*fsets)
 {
 int i, j, k, l;
 
@@ -225,14 +225,17 @@ static void build_filter(int16_t 
table[DST_MAX_ELEMENTS][16][256], const Table *
 int total = av_clip(length - j * 8, 0, 8);
 
 for (k = 0; k < 256; k++) {
-int v = 0;
+int64_t v = 0;
 
 for (l = 0; l < total; l++)
 v += (((k >> l) & 1) * 2 - 1) * fsets->coeff[i][j * 8 + l];
+if ((int16_t)v != v)
+return AVERROR_INVALIDDATA;
 table[i][j][k] = v;
 }
 }
 }
+return 0;
 }
 
 static int decode_frame(AVCodecContext *avctx, void *data,
@@ -328,7 +331,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 return AVERROR_INVALIDDATA;
 ac_init(ac, gb);
 
-build_filter(s->filter, >fsets);
+ret = build_filter(s->filter, >fsets);
+if (ret < 0)
+return ret;
 
 memset(s->status, 0xAA, sizeof(s->status));
 memset(dsd, 0, frame->nb_samples * 4 * channels);

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

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


[FFmpeg-cvslog] avformat/spdifdec: Use 64bit to compute bit rate

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 18:12:11 2022 +0200| [831a251ac6d096d20967990e92fd8b2874f92e3f] | 
committer: Michael Niedermayer

avformat/spdifdec: Use 64bit to compute bit rate

Fixes: signed integer overflow: 32 * 553590816 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6564974517944320

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 4075f0cec1830a7ac081b1a23bd3f5c4e266fe26)
Signed-off-by: Michael Niedermayer 

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

 libavformat/spdifdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
index e39a304247..58d88d2862 100644
--- a/libavformat/spdifdec.c
+++ b/libavformat/spdifdec.c
@@ -226,7 +226,7 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
 if (!s->bit_rate && s->streams[0]->codecpar->sample_rate)
 /* stream bitrate matches 16-bit stereo PCM bitrate for currently
supported codecs */
-s->bit_rate = 2 * 16 * s->streams[0]->codecpar->sample_rate;
+s->bit_rate = 2 * 16LL * s->streams[0]->codecpar->sample_rate;
 
 return 0;
 }

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

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


[FFmpeg-cvslog] avformat/rpl: Use 64bit for duration computation

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 16:49:26 2022 +0200| [109a9f366b629ad60e808b86f061a62086face6e] | 
committer: Michael Niedermayer

avformat/rpl: Use 64bit for duration computation

Fixes: signed integer overflow: 24709512 * 88 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6737973728641024

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 529f64b2eb98e0c3ae4944abd5d01fa7c1def047)
Signed-off-by: Michael Niedermayer 

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

 libavformat/rpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index 459791ffd3..75aed739a0 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -277,7 +277,7 @@ static int rpl_read_header(AVFormatContext *s)
 error |= read_line(pb, line, sizeof(line));  // size of "helpful" sprite
 if (vst) {
 error |= read_line(pb, line, sizeof(line));  // offset to key frame 
list
-vst->duration = number_of_chunks * rpl->frames_per_chunk;
+vst->duration = number_of_chunks * (int64_t)rpl->frames_per_chunk;
 }
 
 // Read the index

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

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


[FFmpeg-cvslog] avformat/xwma: Use av_rescale() for duration computation

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 16:45:30 2022 +0200| [45ec9713c7855d6e9188f62d2604771bcc0a7f2b] | 
committer: Michael Niedermayer

avformat/xwma: Use av_rescale() for duration computation

Fixes: signed integer overflow: 34242363648 * 538976288 cannot be represented 
in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6577923913547776

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2c789f753c3657be9041307f9c03749f5ba5a6bb)
Signed-off-by: Michael Niedermayer 

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

 libavformat/xwma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index 37ab3a1ec0..0dbae43f88 100644
--- a/libavformat/xwma.c
+++ b/libavformat/xwma.c
@@ -278,7 +278,7 @@ static int xwma_read_header(AVFormatContext *s)
  * the total duration using the average bits per sample and the
  * total data length.
  */
-st->duration = (size<<3) * st->codecpar->sample_rate / 
st->codecpar->bit_rate;
+st->duration = av_rescale((size<<3), st->codecpar->sample_rate, 
st->codecpar->bit_rate);
 }
 
 fail:

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

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


[FFmpeg-cvslog] avformat/flvdec: Use 64bit for sum_flv_tag_size

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 13:38:21 2022 +0200| [8ba80715075668b28c9039016d06eaaa611c32ff] | 
committer: Michael Niedermayer

avformat/flvdec: Use 64bit for sum_flv_tag_size

Fixes: signed integer overflow: 2138820085 + 16130322 cannot be represented in 
type 'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-6704728165187584

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 7124f10c1d521096042ba3c9c519828147f78c46)
Signed-off-by: Michael Niedermayer 

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

 libavformat/flvdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 42992d3fb3..14fede24a4 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -65,7 +65,7 @@ typedef struct FLVContext {
 uint8_t resync_buffer[2*RESYNC_BUFFER_SIZE];
 
 int broken_sizes;
-int sum_flv_tag_size;
+int64_t sum_flv_tag_size;
 
 int last_keyframe_stream_index;
 int keyframe_count;
@@ -1033,7 +1033,7 @@ retry:
 type = (avio_r8(s->pb) & 0x1F);
 orig_size =
 size = avio_rb24(s->pb);
-flv->sum_flv_tag_size += size + 11;
+flv->sum_flv_tag_size += size + 11LL;
 dts  = avio_rb24(s->pb);
 dts |= (unsigned)avio_r8(s->pb) << 24;
 av_log(s, AV_LOG_TRACE, "type:%d, size:%d, last:%d, dts:%"PRId64" 
pos:%"PRId64"\n", type, size, last, dts, avio_tell(s->pb));
@@ -1335,7 +1335,7 @@ leave:
 !avio_feof(s->pb) &&
 (last != orig_size || !last) && last != flv->sum_flv_tag_size &&
 !flv->broken_sizes) {
-av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %d\n", last, 
orig_size + 11, flv->sum_flv_tag_size);
+av_log(s, AV_LOG_ERROR, "Packet mismatch %d %d %"PRId64"\n", last, 
orig_size + 11, flv->sum_flv_tag_size);
 avio_seek(s->pb, pos + 1, SEEK_SET);
 ret = resync(s);
 av_packet_unref(pkt);

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

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


[FFmpeg-cvslog] avformat/sbgdec: clamp end_ts

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 16:29:37 2022 +0200| [eff1e619a9846e07c926a5a170b3dea72ca7a684] | 
committer: Michael Niedermayer

avformat/sbgdec: clamp end_ts

Fixes: signed integer overflow: 9223372036851135042 + 15666854 cannot be 
represented in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6573717339111424

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 981f5e46afa3673dfa43eb2bf5017680d5df25dd)
Signed-off-by: Michael Niedermayer 

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

 libavformat/sbgdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index baffbbd6fd..2019995b09 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -1479,7 +1479,7 @@ static int sbg_read_packet(AVFormatContext *avf, AVPacket 
*packet)
 int ret;
 
 ts = ffstream(avf->streams[0])->cur_dts;
-end_ts = ts + avf->streams[0]->codecpar->frame_size;
+end_ts = av_sat_add64(ts, avf->streams[0]->codecpar->frame_size);
 if (avf->streams[0]->duration != AV_NOPTS_VALUE)
 end_ts = FFMIN(avf->streams[0]->start_time + avf->streams[0]->duration,
end_ts);

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

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


[FFmpeg-cvslog] avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration calculation

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 16:42:21 2022 +0200| [c895e6d0b34c328690f8c69946f15f73265ae7ae] | 
committer: Michael Niedermayer

avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration 
calculation

Fixes: signed integer overflow: 72128794995445727 * 240 cannot be represented 
in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SDS_fuzzer-6628185583779840

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit aa8eb1bed075931b0ce0a8bc9a8ff5882830044c)
Signed-off-by: Michael Niedermayer 

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

 libavformat/sdsdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/sdsdec.c b/libavformat/sdsdec.c
index 073dadafbb..6ab20a63b4 100644
--- a/libavformat/sdsdec.c
+++ b/libavformat/sdsdec.c
@@ -112,7 +112,7 @@ static int sds_read_header(AVFormatContext *ctx)
 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
 st->codecpar->channels = 1;
 st->codecpar->sample_rate = sample_period ? 10 / sample_period : 
16000;
-st->duration = (avio_size(pb) - 21) / (127) * s->size / 4;
+st->duration = av_rescale((avio_size(pb) - 21) / 127,  s->size, 4);
 
 avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
 

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

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


[FFmpeg-cvslog] avformat/sbgdec: Check ts_int in genrate_intervals

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 16:35:41 2022 +0200| [ba1b943c055ccf5b2541fe258a1d1e4d4d28a478] | 
committer: Michael Niedermayer

avformat/sbgdec: Check ts_int in genrate_intervals

There is probably a better place to check for this, but better
here than nowhere

Fixes: signed integer overflow: -9223372036824775808 - 864 cannot be 
represented in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6601162580688896

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 5f529e9147a5c5c8ecf8d5ef0dd569194ce30eed)
Signed-off-by: Michael Niedermayer 

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

 libavformat/sbgdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index 2019995b09..ad611a1c18 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -1317,6 +1317,8 @@ static int generate_intervals(void *log, struct 
sbg_script *s, int sample_rate,
 
 /* Pseudo event before the first one */
 ev0 = s->events[s->nb_events - 1];
+if (av_sat_sub64(ev0.ts_int, period) != (uint64_t)ev0.ts_int - period)
+return AVERROR_INVALIDDATA;
 ev0.ts_int   -= period;
 ev0.ts_trans -= period;
 ev0.ts_next  -= period;

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

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


[FFmpeg-cvslog] avformat/nutdec: Check fields

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 14:47:25 2022 +0200| [cdf35ba1d12bd86dc3e66af3c46e82451df5d96e] | 
committer: Michael Niedermayer

avformat/nutdec: Check fields

Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6566001610719232

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2c146406eac06f3d3cd3d981c29e7affd834cb4d)
Signed-off-by: Michael Niedermayer 

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

 libavformat/nutdec.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index c6b9db5cb3..620c54d404 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -244,6 +244,11 @@ static int decode_main_header(NUTContext *nut)
 for (i = 0; i < 256;) {
 int tmp_flags  = ffio_read_varlen(bc);
 int tmp_fields = ffio_read_varlen(bc);
+if (tmp_fields < 0) {
+av_log(s, AV_LOG_ERROR, "fields %d is invalid\n", tmp_fields);
+ret = AVERROR_INVALIDDATA;
+goto fail;
+}
 
 if (tmp_fields > 0)
 tmp_pts = get_s(bc);

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

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


[FFmpeg-cvslog] avformat/jacosubdec: Fix overflow in get_shift()

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 22:55:24 2022 +0200| [b8d29eab19f8a8bd82ec96f88dcef13a87b3d024] | 
committer: Michael Niedermayer

avformat/jacosubdec: Fix overflow in get_shift()

Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-6722544461283328
Fixes: signed integer overflow: 48214448 * 60 cannot be represented in type 
'int'

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b1a68127bbcd3d638363fa0249982c494e87c9e2)
Signed-off-by: Michael Niedermayer 

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

 libavformat/jacosubdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 68ed7511d7..a4b6c0fe40 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -145,7 +145,7 @@ static int get_shift(int timeres, const char *buf)
 ret = 0;
 switch (n) {
 case 4:
-ret = sign * (((int64_t)a*3600 + b*60 + c) * timeres + d);
+ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d);
 break;
 case 3:
 ret = sign * (( (int64_t)a*60 + b) * timeres + c);

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

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


[FFmpeg-cvslog] avformat/rmdec: check tag_size

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 15:06:25 2022 +0200| [626094b9d34edb2d83cb6ba17fcb10083e0be55c] | 
committer: Michael Niedermayer

avformat/rmdec: check tag_size

Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6598073725353984

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2cb7ee8a36bddd3425897135db514ca62fec6e44)
Signed-off-by: Michael Niedermayer 

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

 libavformat/rmdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index b0a38bee83..dbbc5d5466 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -564,6 +564,8 @@ static int rm_read_header(AVFormatContext *s)
 }
 
 tag_size = avio_rb32(pb);
+if (tag_size < 0)
+return AVERROR_INVALIDDATA;
 avio_skip(pb, tag_size - 8);
 
 for(;;) {

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

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


[FFmpeg-cvslog] avformat/dhav: Use 64bit seek_back

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 21:54:31 2022 +0200| [ad15735158c2f127a05ed4b8d9d1dbf785bd76fe] | 
committer: Michael Niedermayer

avformat/dhav: Use 64bit seek_back

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an 
unsigned type to negate this value to itself
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-6604736532447232

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 10453f5192869b63b071aee3962ae2c712f9bfd3)
Signed-off-by: Michael Niedermayer 

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

 libavformat/dhav.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index 6c1cdde32c..33b473d537 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -242,7 +242,7 @@ static int64_t get_duration(AVFormatContext *s)
 avio_seek(s->pb, avio_size(s->pb) - 8, SEEK_SET);
 while (avio_tell(s->pb) > 12 && max_interations--) {
 if (avio_rl32(s->pb) == MKTAG('d','h','a','v')) {
-int seek_back = avio_rl32(s->pb);
+int64_t seek_back = avio_rl32(s->pb);
 
 avio_seek(s->pb, -seek_back, SEEK_CUR);
 read_chunk(s);

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

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


[FFmpeg-cvslog] avformat/dxa: avoid bpc overflows

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 22:40:47 2022 +0200| [622893afe30bdd81bbe62f505fbef6a05a5e6d57] | 
committer: Michael Niedermayer

avformat/dxa: avoid bpc overflows

Fixes: signed integer overflow: 2147483647 + 32 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-6639823726706688

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 93db0f0740cacd64ae07b5e8606b70021e48d364)
Signed-off-by: Michael Niedermayer 

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

 libavformat/dxa.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/dxa.c b/libavformat/dxa.c
index 16fbb08156..474b85270a 100644
--- a/libavformat/dxa.c
+++ b/libavformat/dxa.c
@@ -118,9 +118,12 @@ static int dxa_read_header(AVFormatContext *s)
 if(tag == MKTAG('d', 'a', 't', 'a')) break;
 avio_skip(pb, fsize);
 }
-c->bpc = (fsize + c->frames - 1) / c->frames;
-if(ast->codecpar->block_align)
+c->bpc = (fsize + (int64_t)c->frames - 1) / c->frames;
+if(ast->codecpar->block_align) {
+if (c->bpc > INT_MAX - ast->codecpar->block_align + 1)
+return AVERROR_INVALIDDATA;
 c->bpc = ((c->bpc + ast->codecpar->block_align - 1) / 
ast->codecpar->block_align) * ast->codecpar->block_align;
+}
 c->bytes_left = fsize;
 c->wavpos = avio_tell(pb);
 avio_seek(pb, c->vidpos, SEEK_SET);

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

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


[FFmpeg-cvslog] avformat/cafdec: Check that nb_frasmes fits within 64bit

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 21:48:43 2022 +0200| [91376b3cc47295f40e3ee6e183df6a40a402f8d5] | 
committer: Michael Niedermayer

avformat/cafdec: Check that nb_frasmes fits within 64bit

Fixes: signed integer overflow: 1099511693312 * 538976288 cannot be represented 
in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6565048815845376

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d4bb4e375975dc0d31d5309106cf6ee0ed75140f)
Signed-off-by: Michael Niedermayer 

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

 libavformat/cafdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index d5668bfe1a..7c55f529d3 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -342,7 +342,7 @@ static int read_header(AVFormatContext *s)
 
 found_data:
 if (caf->bytes_per_packet > 0 && caf->frames_per_packet > 0) {
-if (caf->data_size > 0)
+if (caf->data_size > 0 && caf->data_size / caf->bytes_per_packet < 
INT64_MAX / caf->frames_per_packet)
 st->nb_frames = (caf->data_size / caf->bytes_per_packet) * 
caf->frames_per_packet;
 } else if (ffstream(st)->nb_index_entries && st->duration > 0) {
 if (st->codecpar->sample_rate && caf->data_size / st->duration > 
INT64_MAX / st->codecpar->sample_rate / 8) {

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

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


[FFmpeg-cvslog] avformat/asfdec_o: Limit packet offset

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 21:30:55 2022 +0200| [eef9a574df67106d936397d6a3396e39b73a] | 
committer: Michael Niedermayer

avformat/asfdec_o: Limit packet offset

avoids overflows with it

Fixes: signed integer overflow: 9223372036846866010 + 4294967047 cannot be 
represented in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6538296768987136
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-657169555665715

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 736e9e69d5dbbe1d81885dfef59917eb915d2f96)
Signed-off-by: Michael Niedermayer 

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

 libavformat/asfdec_o.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 74f283fa51..cbb716b145 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1242,6 +1242,8 @@ static int asf_read_packet_header(AVFormatContext *s)
 unsigned char error_flags, len_flags, pay_flags;
 
 asf->packet_offset = avio_tell(pb);
+if (asf->packet_offset > INT64_MAX/2)
+asf->packet_offset = 0;
 error_flags = avio_r8(pb); // read Error Correction Flags
 if (error_flags & ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT) {
 if (!(error_flags & ASF_ERROR_CORRECTION_LENGTH_TYPE)) {

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

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


[FFmpeg-cvslog] avformat/ape: Check frames size

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 21:19:53 2022 +0200| [a00c812a9bee5eff1645711ee9a89ea1a9ac7f4f] | 
committer: Michael Niedermayer

avformat/ape: Check frames size

Fixes: signed integer overflow: 9223372036854775806 + 3 cannot be represented 
in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APE_fuzzer-6389264140599296

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d0349c9929e2891c90011a83152624d5cf18e628)
Signed-off-by: Michael Niedermayer 

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

 libavformat/ape.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index 3f43055d9f..6ef8aecdbb 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -298,6 +298,8 @@ static int ape_read_header(AVFormatContext * s)
 ape->frames[i].pos  -= ape->frames[i].skip;
 ape->frames[i].size += ape->frames[i].skip;
 }
+if (ape->frames[i].size > INT_MAX - 3)
+return AVERROR_INVALIDDATA;
 ape->frames[i].size = (ape->frames[i].size + 3) & ~3;
 }
 if (ape->fileversion < 3810) {

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

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


[FFmpeg-cvslog] avformat/icodec: Check nb_pal

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 23:15:56 2022 +0200| [35d5d2a4b2b880fa114fcdd71963190d0d13e550] | 
committer: Michael Niedermayer

avformat/icodec: Check nb_pal

Fixes: signed integer overflow: 538976288 * 4 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-6690068904935424

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit db73ae0dc114aa6fae08e69f977944f056a24995)
Signed-off-by: Michael Niedermayer 

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

 libavformat/icodec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index 2e677c78f1..e533f70006 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -197,6 +197,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
 AV_WL32(buf + 32, image->nb_pal);
 }
 
+if (image->nb_pal > INT_MAX / 4 - 14 - 40)
+return AVERROR_INVALIDDATA;
+
 AV_WL32(buf - 4, 14 + 40 + image->nb_pal * 4);
 AV_WL32(buf + 8, AV_RL32(buf + 8) / 2);
 }

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

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


[FFmpeg-cvslog] avformat/mxfdec: Check run_in is within 65536

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 14:28:03 2022 +0200| [51ccf7f5c6c5cb094c74526b21ce1e70d6e8d4ec] | 
committer: Michael Niedermayer

avformat/mxfdec: Check run_in is within 65536

Fixes: signed integer overflow: 9223372036854775807 - -2146905566 cannot be 
represented in type 'long'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6570996594769920

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 7786097825d9e3f02b4574c1924c28818eb83340)
Signed-off-by: Michael Niedermayer 

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

 libavformat/mxfdec.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index f8c1df796b..b31ddb5b21 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -63,6 +63,7 @@
 #include "mxf.h"
 
 #define MXF_MAX_CHUNK_SIZE (32 << 20)
+#define RUN_IN_MAX (65535+1)  // S377m-2004 section 5.5 and S377-1-2009 
section 6.5, the +1 is to be slightly more tolerant
 
 typedef enum {
 Header,
@@ -3657,6 +3658,7 @@ static int mxf_read_header(AVFormatContext *s)
 KLVPacket klv;
 int64_t essence_offset = 0;
 int ret;
+int64_t run_in;
 
 mxf->last_forward_tell = INT64_MAX;
 
@@ -3666,7 +3668,10 @@ static int mxf_read_header(AVFormatContext *s)
 }
 avio_seek(s->pb, -14, SEEK_CUR);
 mxf->fc = s;
-mxf->run_in = avio_tell(s->pb);
+run_in = avio_tell(s->pb);
+if (run_in < 0 || run_in > RUN_IN_MAX)
+return AVERROR_INVALIDDATA;
+mxf->run_in = run_in;
 
 mxf_read_random_index_pack(s);
 

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

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


[FFmpeg-cvslog] avformat/aiffdec: Use 64bit for block_duration use

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 16:32:09 2022 +0200| [2a6e750c87c2b5b87817bf456735c74cf79b4694] | 
committer: Michael Niedermayer

avformat/aiffdec: Use 64bit for block_duration use

Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 9303ba272e988d87084880c57056b750cc5ffd08)
Signed-off-by: Michael Niedermayer 

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

 libavformat/aiffdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 154e5eaf7a..0ebfdee448 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -425,7 +425,7 @@ static int aiff_read_packet(AVFormatContext *s,
 pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
 /* Only one stream in an AIFF file */
 pkt->stream_index = 0;
-pkt->duration = (res / st->codecpar->block_align) * 
aiff->block_duration;
+pkt->duration = (res / st->codecpar->block_align) * (int64_t) 
aiff->block_duration;
 return 0;
 }
 

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

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


[FFmpeg-cvslog] avformat/aiffdec: Check block_duration

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 17 16:32:08 2022 +0200| [ed455b98d052808c39192c0ce4335ac017db6127] | 
committer: Michael Niedermayer

avformat/aiffdec: Check block_duration

Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 
'int'
Fixes: 
50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 1c2b6265c87417033f990fa4a14da9d4008320a4)
Signed-off-by: Michael Niedermayer 

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

 libavformat/aiffdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 321e07a36b..154e5eaf7a 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -369,6 +369,8 @@ got_sound:
 av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid 
block_align value\n");
 return AVERROR_INVALIDDATA;
 }
+if (aiff->block_duration < 0)
+return AVERROR_INVALIDDATA;
 
 /* Now positioned, get the sound data start and end */
 avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);

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

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


[FFmpeg-cvslog] avcodec/mobiclip: Check quantizer for overflow

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 10 23:58:36 2022 +0200| [4dcc092a5a302349b653ad9eb123443d6a3ed365] | 
committer: Michael Niedermayer

avcodec/mobiclip: Check quantizer for overflow

Fixes: signed integer overflow: 127 + 2147483536 cannot be represented in type 
'int'
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-6014034970804224

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 677e27a9afa7305a918336699b377fd5b42cc299)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mobiclip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index 23d64f76f6..281b63a0bc 100644
--- a/libavcodec/mobiclip.c
+++ b/libavcodec/mobiclip.c
@@ -329,7 +329,7 @@ static av_cold int mobiclip_init(AVCodecContext *avctx)
 return 0;
 }
 
-static int setup_qtables(AVCodecContext *avctx, int quantizer)
+static int setup_qtables(AVCodecContext *avctx, int64_t quantizer)
 {
 MobiClipContext *s = avctx->priv_data;
 int qx, qy;
@@ -1255,7 +1255,7 @@ static int mobiclip_decode(AVCodecContext *avctx, void 
*data,
 frame->key_frame = 0;
 s->dct_tab_idx = 0;
 
-ret = setup_qtables(avctx, s->quantizer + get_se_golomb(gb));
+ret = setup_qtables(avctx, s->quantizer + (int64_t)get_se_golomb(gb));
 if (ret < 0)
 return ret;
 

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

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


[FFmpeg-cvslog] avformat/mxfdec: only probe max run in

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Wed Sep 21 18:23:30 2022 +0200| [1bc5684211eeebeb723787b57bdc32098a6f217a] | 
committer: Michael Niedermayer

avformat/mxfdec: only probe max run in

Suggested-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 1182bbb2c3226260ed672920251e3410bde8c6c9)
Signed-off-by: Michael Niedermayer 

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

 libavformat/mxfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index b31ddb5b21..6fa44351e6 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -4077,7 +4077,7 @@ static int mxf_read_close(AVFormatContext *s)
 
 static int mxf_probe(const AVProbeData *p) {
 const uint8_t *bufp = p->buf;
-const uint8_t *end = p->buf + p->buf_size;
+const uint8_t *end = p->buf + FFMIN(p->buf_size, RUN_IN_MAX + 1 + 
sizeof(mxf_header_partition_pack_key));
 
 if (p->buf_size < sizeof(mxf_header_partition_pack_key))
 return 0;

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

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


[FFmpeg-cvslog] avcodec/apedec: Fix integer overflow in filter_3800()

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 11 00:30:42 2022 +0200| [d5973433214d1ec2efb28c32c20facc66dc18625] | 
committer: Michael Niedermayer

avcodec/apedec: Fix integer overflow in filter_3800()

Fixes: signed integer overflow: -2147448926 + -198321 cannot be represented in 
type 'int'
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5739619273015296
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6744428485672960

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit f05247f6a4698c14f1cd523daa90188f50dcf6ad)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 8e56b96726..5c7305e0b0 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -930,7 +930,7 @@ static av_always_inline int filter_3800(APEPredictor *p,
 p->coeffsB[filter][0] += (((d3 >> 29) & 4) - 2) * sign;
 p->coeffsB[filter][1] -= (((d4 >> 30) & 2) - 1) * sign;
 
-p->filterB[filter] = p->lastA[filter] + (predictionB >> shift);
+p->filterB[filter] = p->lastA[filter] + (unsigned)(predictionB >> shift);
 p->filterA[filter] = p->filterB[filter] + 
(unsigned)((int)(p->filterA[filter] * 31U) >> 5);
 
 return p->filterA[filter];

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

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


[FFmpeg-cvslog] avcodec/exr: Check preview psize

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sat Sep 10 23:54:17 2022 +0200| [ef8a0dc80037633b88a2b1e0f40be601f15afc33] | 
committer: Michael Niedermayer

avcodec/exr: Check preview psize

Fixes: signed integer overflow: 17121181824 * 538976288 cannot be represented 
in type 'long long'
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5915330316206080

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit ac26712e35f5ebc726d1be14bb4a420949e66604)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/exr.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 85b0cab36b..aebee1e326 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1950,9 +1950,12 @@ static int decode_header(EXRContext *s, AVFrame *frame)
  "preview", 16)) >= 0) {
 uint32_t pw = bytestream2_get_le32(gb);
 uint32_t ph = bytestream2_get_le32(gb);
-int64_t psize = 4LL * pw * ph;
+uint64_t psize = pw * ph;
+if (psize > INT64_MAX / 4)
+return AVERROR_INVALIDDATA;
+psize *= 4;
 
-if (psize >= bytestream2_get_bytes_left(gb))
+if ((int64_t)psize >= bytestream2_get_bytes_left(gb))
 return AVERROR_INVALIDDATA;
 
 bytestream2_skip(gb, psize);

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

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


[FFmpeg-cvslog] avcodec/mjpegdec: Check for unsupported bayer case

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 18 23:42:02 2022 +0200| [cef1c6311d1f127fb61c19fd13689f1c2f40e428] | 
committer: Michael Niedermayer

avcodec/mjpegdec: Check for unsupported bayer case

Fixes: out of array access
Fixes: 
51462/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-662559341582745

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit dd81cc22b3dd5bd6badf012b4fe4c19e062650f4)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mjpegdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index c4e8a598eb..c01f9ee9fc 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1208,6 +1208,8 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, 
int nb_components, int p
 ptr[3*mb_x + 2] = buffer[mb_x][2] + ptr[3*mb_x + 1];
 }
 } else if (s->bayer) {
+if (s->bits <= 8)
+return AVERROR_PATCHWELCOME;
 if (nb_components == 1) {
 /* Leave decoding to the TIFF/DNG decoder (see comment in 
ff_mjpeg_decode_sof) */
 for (mb_x = 0; mb_x < width; mb_x++)

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

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


[FFmpeg-cvslog] libavformat/hls: Free keys

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Fri Sep  9 00:32:23 2022 +0200| [71dd8b8da0676fcd838daf8e4fb76d6b89174d19] | 
committer: Michael Niedermayer

libavformat/hls: Free keys

Fixes: memleak
Fixes: 
50703/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-6399058578636800

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d32a9f3137c91de86547601a38fea0693c3497f1)
Signed-off-by: Michael Niedermayer 

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

 libavformat/hls.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 53d30d97ad..d5e9b2179f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -243,6 +243,7 @@ static void free_init_section_list(struct playlist *pls)
 {
 int i;
 for (i = 0; i < pls->n_init_sections; i++) {
+av_freep(>init_sections[i]->key);
 av_freep(>init_sections[i]->url);
 av_freep(>init_sections[i]);
 }

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

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


[FFmpeg-cvslog] avcodec/tta: Check 24bit scaling for overflow

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Sun Sep 11 00:11:20 2022 +0200| [d282d019c27f3d9d3e5b76a6415b1dd29042bb8c] | 
committer: Michael Niedermayer

avcodec/tta: Check 24bit scaling for overflow

Fixes: signed integer overflow: -8427924 * 256 cannot be represented in type 
'int'
Fixes: 
48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5409428670644224

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 3993345f915bccceee315f44d412445346990e14)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/tta.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 17b4ca9032..109d01ff24 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -373,8 +373,15 @@ static int tta_decode_frame(AVCodecContext *avctx, void 
*data,
 case 3: {
 // shift samples for 24-bit sample format
 int32_t *samples = (int32_t *)frame->data[0];
-for (i = 0; i < framelen * s->channels; i++)
-*samples++ *= 256;
+int overflow = 0;
+
+for (i = 0; i < framelen * s->channels; i++) {
+int scaled = *samples * 256U;
+overflow += (scaled >> 8 != *samples);
+*samples++ = scaled;
+}
+if (overflow)
+av_log(avctx, AV_LOG_WARNING, "%d overflows occurred on 24bit 
upscale\n", overflow);
 // reset decode buffer
 s->decode_buffer = NULL;
 break;

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

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


[FFmpeg-cvslog] avcodec/tiff: Fix loop detection

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Mon Sep 12 19:55:09 2022 +0200| [db51f193e4d4c135164656b33adad519cd19b8be] | 
committer: Michael Niedermayer

avcodec/tiff: Fix loop detection

Fixes regression with tickets/4364/L1004220.DNG

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 43a4854510a3d596e114d899177a5b3b323ca9fb)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/tiff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 34aab924d3..f66268568d 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1750,7 +1750,7 @@ static int decode_frame(AVCodecContext *avctx,
 TiffContext *const s = avctx->priv_data;
 AVFrame *const p = data;
 ThreadFrame frame = { .f = data };
-unsigned off, last_off;
+unsigned off, last_off = 0;
 int le, ret, plane, planes;
 int i, j, entries, stride;
 unsigned soff, ssize;
@@ -1815,7 +1815,6 @@ again:
 /** whether we should process this multi-page IFD's next page */
 retry_for_page = s->get_page && s->cur_page + 1 < s->get_page;  // 
get_page is 1-indexed
 
-last_off = off;
 if (retry_for_page) {
 // set offset to the next IFD
 off = ff_tget_long(>gb, le);
@@ -1833,6 +1832,7 @@ again:
 avpriv_request_sample(s->avctx, "non increasing IFD offset");
 return AVERROR_INVALIDDATA;
 }
+last_off = off;
 if (off >= UINT_MAX - 14 || avpkt->size < off + 14) {
 av_log(avctx, AV_LOG_ERROR, "IFD offset is greater than image 
size\n");
 return AVERROR_INVALIDDATA;

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

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


[FFmpeg-cvslog] avcodec/speedhq: Check width

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Thu Aug 18 23:41:57 2022 +0200| [14ec214d5c61e7af4ec0da2838da35a3233990f6] | 
committer: Michael Niedermayer

avcodec/speedhq: Check width

Fixes: out of array access
Fixes: 
50014/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-4748914632294400

Alternatively the buffer size can be increased

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit f0395f9ef6051315973f1fdded1804f81458566d)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/speedhq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 743dacc6ce..128663ab75 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -497,7 +497,7 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
 uint32_t second_field_offset;
 int ret;
 
-if (buf_size < 4 || avctx->width < 8)
+if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 != 0)
 return AVERROR_INVALIDDATA;
 
 quality = buf[0];

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

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


[FFmpeg-cvslog] avcodec/fmvc: Move frame allocation to a later stage

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Fri Jun 10 23:09:09 2022 +0200| [728b3bc74ed4541680cd514e2487e7a5ea22020d] | 
committer: Michael Niedermayer

avcodec/fmvc: Move frame allocation to a later stage

This way more things are checked before allocation

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 9783749c66bf6ca2ce7a6db4c74957fe77cbe803)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/fmvc.c | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index aab46da9cf..1e34f134a4 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -401,20 +401,17 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 PutByteContext *pb = >pb;
 AVFrame *frame = data;
 int ret, y, x;
+int key_frame;
 
 if (avpkt->size < 8)
 return AVERROR_INVALIDDATA;
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 bytestream2_init(gb, avpkt->data, avpkt->size);
 bytestream2_skip(gb, 2);
 
-frame->key_frame = !!bytestream2_get_le16(gb);
-frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : 
AV_PICTURE_TYPE_P;
+key_frame = !!bytestream2_get_le16(gb);
 
-if (frame->key_frame) {
+if (key_frame) {
 const uint8_t *src;
 unsigned type, size;
 uint8_t *dst;
@@ -434,6 +431,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 return AVERROR_PATCHWELCOME;
 }
 
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
+frame->key_frame = 1;
+frame->pict_type = AV_PICTURE_TYPE_I;
+
 src = s->buffer;
 dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
 for (y = 0; y < avctx->height; y++) {
@@ -514,6 +517,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 dst = [block_h * s->stride];
 }
 
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
+frame->key_frame = 0;
+frame->pict_type = AV_PICTURE_TYPE_P;
+
 ssrc = s->buffer;
 ddst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
 for (y = 0; y < avctx->height; y++) {

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

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


[FFmpeg-cvslog] avfilter/vf_showinfo: remove backspaces

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Thu Jul 21 20:15:06 2022 +0200| [6535e158f9af0dbea6de7fc62be46a86d9e00d34] | 
committer: Michael Niedermayer

avfilter/vf_showinfo: remove backspaces

They mess with storing editing and comparing the results

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 31581ae7ee6d007f2f2dcd16de5df991ba7aa1b6)
Signed-off-by: Michael Niedermayer 

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

 libavfilter/vf_showinfo.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 71728bced4..2915cc15b0 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -654,12 +654,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 av_log(ctx, AV_LOG_INFO, " %08"PRIX32, plane_checksum[plane]);
 av_log(ctx, AV_LOG_INFO, "] mean:[");
 for (plane = 0; plane < 4 && frame->data[plane] && 
frame->linesize[plane]; plane++)
-av_log(ctx, AV_LOG_INFO, "%"PRId64" ", (sum[plane] + 
pixelcount[plane]/2) / pixelcount[plane]);
-av_log(ctx, AV_LOG_INFO, "\b] stdev:[");
+av_log(ctx, AV_LOG_INFO, "%s%"PRId64,
+   plane ? " ":"",
+   (sum[plane] + pixelcount[plane]/2) / pixelcount[plane]);
+av_log(ctx, AV_LOG_INFO, "] stdev:[");
 for (plane = 0; plane < 4 && frame->data[plane] && 
frame->linesize[plane]; plane++)
-av_log(ctx, AV_LOG_INFO, "%3.1f ",
+av_log(ctx, AV_LOG_INFO, "%s%3.1f",
+   plane ? " ":"",
sqrt((sum2[plane] - 
sum[plane]*(double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
-av_log(ctx, AV_LOG_INFO, "\b]");
+av_log(ctx, AV_LOG_INFO, "]");
 }
 av_log(ctx, AV_LOG_INFO, "\n");
 

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

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


[FFmpeg-cvslog] avcodec/bink: disallow odd positioned scaled blocks

2022-11-04 Thread Michael Niedermayer
ffmpeg | branch: release/5.0 | Michael Niedermayer  | 
Mon Jun 13 02:01:20 2022 +0200| [1f3236ac1ef692ef015cccec58b88ec8f4f0fcf1] | 
committer: Michael Niedermayer

avcodec/bink: disallow odd positioned scaled blocks

Fixes: out of array access
Fixes: 
47911/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-6194020855971840

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b14104a6376cd774b08cbe5fda56b34320a41b2e)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/bink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 45dd8d156d..cd0457471b 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1087,7 +1087,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame 
*frame, GetBitContext *gb,
 for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) {
 blk = get_value(c, BINK_SRC_BLOCK_TYPES);
 // 16x16 block type on odd line means part of the already decoded 
block, so skip it
-if ((by & 1) && blk == SCALED_BLOCK) {
+if (((by & 1) || (bx & 1)) && blk == SCALED_BLOCK) {
 bx++;
 dst  += 8;
 prev += 8;

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

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


[FFmpeg-cvslog] avfilter/vf_pseudocolor: add spectral preset

2022-11-04 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Thu Nov  3 13:41:58 
2022 +0100| [4dda3b165337af9b421ca76835acd5712ec108b5] | committer: Paul B Mahol

avfilter/vf_pseudocolor: add spectral preset

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

 doc/filters.texi |  1 +
 libavfilter/vf_pseudocolor.c | 11 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index bcd19cf931..006173ba47 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -18886,6 +18886,7 @@ Available LUTs:
 @item nominal
 @item preferred
 @item total
+@item spectral
 @end table
 
 @item opacity
diff --git a/libavfilter/vf_pseudocolor.c b/libavfilter/vf_pseudocolor.c
index cb9c9c84cf..89dc2f0901 100644
--- a/libavfilter/vf_pseudocolor.c
+++ b/libavfilter/vf_pseudocolor.c
@@ -67,6 +67,7 @@ enum Curves {
 TURBO,
 CIVIDIS,
 SOLAR,
+SPECTRAL,
 NB_CURVES,
 };
 
@@ -85,6 +86,7 @@ enum Presets {
 PRESET_NOMINAL,
 PRESET_PREFERRED,
 PRESET_TOTAL,
+PRESET_SPECTRAL,
 NB_PRESETS,
 };
 
@@ -174,6 +176,11 @@ static const Curve curves[] =
 },
 .offset = { 0., -9., 9. },
 .fun = { solarfun, solarfun, solarfun }, },
+[SPECTRAL] = {{
+{ -1.6820e-15,   1.4982e-12,  -5.0442e-10,   8.0490e-08,  -6.1903e-06, 
  1.5821e-04, 6.4359e-03,   6.2887e-01 },
+{  1.2526e-15,  -1.2203e-12,   4.7013e-10,  -8.9360e-08,   8.3839e-06, 
 -3.6642e-04, 1.4784e-02,  -9.8075e-03 },
+{  1.4755e-15,  -1.6765e-12,   7.3188e-10,  -1.5522e-07,   1.6406e-05, 
 -7.7883e-04, 1.4502e-02,   2.1597e-01 },
+}, .fun = { limit, limit, limit }, },
 };
 
 static const Preset presets[] =
@@ -191,7 +198,8 @@ static const Preset presets[] =
 [PRESET_RANGE2]  = { 5, spec2_range, NULL, spec2_fills },
 [PRESET_SHADOWS] = { 2, shadows_range, NULL,   shadows_fills },
 [PRESET_HIGHLIGHTS] = { 3, highlights_range, NULL, highlights_fills },
-[PRESET_SOLAR] = { 1, _range, [SOLAR], NULL },
+[PRESET_SOLAR]   = { 1, _range, [SOLAR],   NULL },
+[PRESET_SPECTRAL]= { 1, _range, [SPECTRAL],NULL },
 };
 
 typedef struct PseudoColorContext {
@@ -246,6 +254,7 @@ static const AVOption pseudocolor_options[] = {
 { "nominal",NULL,  0,
AV_OPT_TYPE_CONST,  {.i64=PRESET_NOMINAL}, .flags=FLAGS, "preset" },
 { "preferred",  NULL,  0,
AV_OPT_TYPE_CONST,  {.i64=PRESET_PREFERRED},.flags=FLAGS,"preset" },
 { "total",  NULL,  0,
AV_OPT_TYPE_CONST,  {.i64=PRESET_TOTAL},   .flags=FLAGS, "preset" },
+{ "spectral",   NULL,  0,
AV_OPT_TYPE_CONST,  {.i64=PRESET_SPECTRAL},.flags = FLAGS, "preset" },
 { "opacity", "set pseudocolor opacity",OFFSET(opacity),  
AV_OPT_TYPE_FLOAT,  {.dbl=1}, 0, 1, .flags = FLAGS },
 { NULL }
 };

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

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