[FFmpeg-cvslog] lavd/decklink_dec: Do not set codec_tags.

2020-12-24 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Sun Dec 13 
11:01:02 2020 +0100| [b0a882cc93eb659d3e564b07f4c1f3eb87684bda] | committer: 
Carl Eugen Hoyos

lavd/decklink_dec: Do not set codec_tags.

Only set the pix_fmt for rawvideo.

Fixes ticket #9005.

Reviewed-by: Marton Balint

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

 libavdevice/decklink_dec.cpp | 8 
 1 file changed, 8 deletions(-)

diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index d56d31ebea..6bd4676f5e 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -1320,34 +1320,26 @@ av_cold int ff_decklink_read_header(AVFormatContext 
*avctx)
 switch(ctx->raw_format) {
 case bmdFormat8BitYUV:
 st->codecpar->codec_id= AV_CODEC_ID_RAWVIDEO;
-st->codecpar->codec_tag   = MKTAG('U', 'Y', 'V', 'Y');
 st->codecpar->format  = AV_PIX_FMT_UYVY422;
 st->codecpar->bit_rate= av_rescale(ctx->bmd_width * 
ctx->bmd_height * 16, st->time_base.den, st->time_base.num);
 break;
 case bmdFormat10BitYUV:
 st->codecpar->codec_id= AV_CODEC_ID_V210;
-st->codecpar->codec_tag   = MKTAG('V','2','1','0');
 st->codecpar->bit_rate= av_rescale(ctx->bmd_width * 
ctx->bmd_height * 64, st->time_base.den, st->time_base.num * 3);
-st->codecpar->bits_per_coded_sample = 10;
 break;
 case bmdFormat8BitARGB:
 st->codecpar->codec_id= AV_CODEC_ID_RAWVIDEO;
 st->codecpar->format  = AV_PIX_FMT_0RGB;
-st->codecpar->codec_tag   = avcodec_pix_fmt_to_codec_tag((enum 
AVPixelFormat)st->codecpar->format);
 st->codecpar->bit_rate= av_rescale(ctx->bmd_width * 
ctx->bmd_height * 32, st->time_base.den, st->time_base.num);
 break;
 case bmdFormat8BitBGRA:
 st->codecpar->codec_id= AV_CODEC_ID_RAWVIDEO;
 st->codecpar->format  = AV_PIX_FMT_BGR0;
-st->codecpar->codec_tag   = avcodec_pix_fmt_to_codec_tag((enum 
AVPixelFormat)st->codecpar->format);
 st->codecpar->bit_rate= av_rescale(ctx->bmd_width * 
ctx->bmd_height * 32, st->time_base.den, st->time_base.num);
 break;
 case bmdFormat10BitRGB:
 st->codecpar->codec_id= AV_CODEC_ID_R210;
-st->codecpar->codec_tag   = MKTAG('R','2','1','0');
-st->codecpar->format  = AV_PIX_FMT_RGB48LE;
 st->codecpar->bit_rate= av_rescale(ctx->bmd_width * 
ctx->bmd_height * 30, st->time_base.den, st->time_base.num);
-st->codecpar->bits_per_coded_sample = 10;
 break;
 default:
 char fourcc_str[AV_FOURCC_MAX_STRING_SIZE] = {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] lavf/img2dec: Increase score for very large jpeg images.

2020-12-24 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Thu Dec 24 
13:16:44 2020 +0100| [2943c3debd611c0f37f8ff5eafb34ed369009a9c] | committer: 
Carl Eugen Hoyos

lavf/img2dec: Increase score for very large jpeg images.

Avoids a conflict with the raw mjpeg demuxer.

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

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

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ccb933ae33..1279d47f54 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -817,7 +817,7 @@ static int jpeg_probe(const AVProbeData *p)
 return AVPROBE_SCORE_EXTENSION + 1;
 if (state == SOS)
 return AVPROBE_SCORE_EXTENSION / 2;
-return AVPROBE_SCORE_EXTENSION / 8;
+return AVPROBE_SCORE_EXTENSION / 8 + 1;
 }
 
 static int jpegls_probe(const AVProbeData *p)

___
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] tools/target_dec_fuzzer: Adjust maxpixels for G2M

2020-12-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Nov 17 00:41:45 2020 +0100| [0d4e8e4c97bc8247d619f09b4c64e9dfd5eae024] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Adjust maxpixels for G2M

Fixes: Timeout (50sec -> 3sec)
Fixes: 
27383/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5196953666977792

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=0d4e8e4c97bc8247d619f09b4c64e9dfd5eae024
---

 tools/target_dec_fuzzer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 11530cbf79..e737d434f1 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -150,7 +150,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 case AV_CODEC_ID_DST: maxsamples /= 1<<20; break;
 case AV_CODEC_ID_DXV: maxpixels  /= 32;break;
 case AV_CODEC_ID_FFWAVESYNTH: maxsamples /= 16384; break;
-case AV_CODEC_ID_G2M: maxpixels  /= 64;break;
+case AV_CODEC_ID_G2M: maxpixels  /= 1024;  break;
 case AV_CODEC_ID_GDV: maxpixels  /= 512;   break;
 case AV_CODEC_ID_GIF: maxpixels  /= 16;break;
 case AV_CODEC_ID_HAP: maxpixels  /= 128;   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] avformat/swfdec: Allocate output buffer after reading input

2020-12-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Nov 18 01:29:23 2020 +0100| [aea8d4061d3e662b506df8067b7584dbab0a1851] | 
committer: Michael Niedermayer

avformat/swfdec: Allocate output buffer after reading input

Fixes: Timeout (>10sec -> 0.26sec)
Fixes: 
27419/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-5678307361947648

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=aea8d4061d3e662b506df8067b7584dbab0a1851
---

 libavformat/swfdec.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index fa11c050cd..1463f0ad4d 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -368,14 +368,21 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 ch_id, bmp_fmt, width, height, linesize, len, out_len, 
colormapsize);
 
 zbuf = av_malloc(len);
-buf  = av_malloc(out_len);
-if (!zbuf || !buf) {
+if (!zbuf) {
 res = AVERROR(ENOMEM);
 goto bitmap_end;
 }
 
 len = avio_read(pb, zbuf, len);
-if (len < 0 || (res = uncompress(buf, &out_len, zbuf, len)) != 
Z_OK) {
+if (len < 0)
+goto bitmap_end_skip;
+
+buf  = av_malloc(out_len);
+if (!buf) {
+res = AVERROR(ENOMEM);
+goto bitmap_end;
+}
+if ((res = uncompress(buf, &out_len, zbuf, len)) != Z_OK) {
 av_log(s, AV_LOG_WARNING, "Failed to uncompress one bitmap\n");
 goto bitmap_end_skip;
 }

___
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: clip sample rate

2020-12-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Nov 18 00:48:26 2020 +0100| [684aec6a6872c9e3bb0afee1979f1cd3edd1f8ce] | 
committer: Michael Niedermayer

avformat/cafdec: clip sample rate

Fixes: 1.21126e+111 is outside the range of representable values of type 'int'
Fixes: 
27398/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5412960339755008

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=684aec6a6872c9e3bb0afee1979f1cd3edd1f8ce
---

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

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index c188aad20f..b7a9711cc5 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -70,7 +70,7 @@ static int read_desc_chunk(AVFormatContext *s)
 
 /* parse format description */
 st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
-st->codecpar->sample_rate = av_int2double(avio_rb64(pb));
+st->codecpar->sample_rate = av_clipd(av_int2double(avio_rb64(pb)), 0, 
INT_MAX);
 st->codecpar->codec_tag   = avio_rl32(pb);
 flags = avio_rb32(pb);
 caf->bytes_per_packet  = avio_rb32(pb);

___
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] libswscale: avoid UB nullptr-with-offset.

2020-12-24 Thread Jeremy Leconte
ffmpeg | branch: master | Jeremy Leconte  | Thu Dec 24 
04:27:19 2020 +| [29cef1bcd6baf4394a24b34bfbec59e97bb3875b] | committer: 
Michael Niedermayer

libswscale: avoid UB nullptr-with-offset.

Signed-off-by: Michael Niedermayer 

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

 libswscale/slice.c| 12 
 libswscale/swscale_unscaled.c |  4 +---
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/libswscale/slice.c b/libswscale/slice.c
index 7849b70f4d..d96db13364 100644
--- a/libswscale/slice.c
+++ b/libswscale/slice.c
@@ -158,14 +158,10 @@ int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], 
int stride[4], int src
 chrY + chrH,
 lumY + lumH};
 
-uint8_t *const src_[4] = {src[0] + (relative ? 0 : start[0]) * stride[0],
-  src[1] + (relative ? 0 : start[1]) * stride[1],
-  src[2] + (relative ? 0 : start[2]) * stride[2],
-  src[3] + (relative ? 0 : start[3]) * stride[3]};
-
 s->width = srcW;
 
-for (i = 0; i < 4; ++i) {
+for (i = 0; i < 4 && src[i] != NULL; ++i) {
+uint8_t *const src_i = src[i] + (relative ? 0 : start[i]) * stride[i];
 int j;
 int first = s->plane[i].sliceY;
 int n = s->plane[i].available_lines;
@@ -175,13 +171,13 @@ int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], 
int stride[4], int src
 if (start[i] >= first && n >= tot_lines) {
 s->plane[i].sliceH = FFMAX(tot_lines, s->plane[i].sliceH);
 for (j = 0; j < lines; j+= 1)
-s->plane[i].line[start[i] - first + j] = src_[i] +  j * 
stride[i];
+s->plane[i].line[start[i] - first + j] = src_i +  j * 
stride[i];
 } else {
 s->plane[i].sliceY = start[i];
 lines = lines > n ? n : lines;
 s->plane[i].sliceH = lines;
 for (j = 0; j < lines; j+= 1)
-s->plane[i].line[j] = src_[i] +  j * stride[i];
+s->plane[i].line[j] = src_i +  j * stride[i];
 }
 
 }
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 563de39696..7e92f3fafc 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -1805,7 +1805,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t 
*src[],
 const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);
 const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);
 int plane, i, j;
-for (plane = 0; plane < 4; plane++) {
+for (plane = 0; plane < 4 && dst[plane] != NULL; plane++) {
 int length = (plane == 0 || plane == 3) ? c->srcW  : 
AV_CEIL_RSHIFT(c->srcW,   c->chrDstHSubSample);
 int y =  (plane == 0 || plane == 3) ? srcSliceY: 
AV_CEIL_RSHIFT(srcSliceY, c->chrDstVSubSample);
 int height = (plane == 0 || plane == 3) ? srcSliceH: 
AV_CEIL_RSHIFT(srcSliceH, c->chrDstVSubSample);
@@ -1813,8 +1813,6 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t 
*src[],
 uint8_t *dstPtr = dst[plane] + dstStride[plane] * y;
 int shiftonly = plane == 1 || plane == 2 || (!c->srcRange && plane == 
0);
 
-if (!dst[plane])
-continue;
 // ignore palette for GRAY8
 if (plane == 1 && !dst[2]) continue;
 if (!src[plane] || (plane == 1 && !src[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".