[FFmpeg-cvslog] avcodec/cbs: constify decompose_unit_types

2021-01-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Jan 10 19:22:59 
2021 -0300| [9219ed213d10fb2ae13da15402f5acf35ffb25ba] | committer: James Almer

avcodec/cbs: constify decompose_unit_types

CBS doesn't change its contents in any way whatsoever internally, and most
users already set it to a const array.

Signed-off-by: James Almer 

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

 libavcodec/av1_frame_split_bsf.c | 2 +-
 libavcodec/av1_parser.c  | 2 +-
 libavcodec/cbs.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/av1_frame_split_bsf.c b/libavcodec/av1_frame_split_bsf.c
index 13bebe19f5..fa8b887b6c 100644
--- a/libavcodec/av1_frame_split_bsf.c
+++ b/libavcodec/av1_frame_split_bsf.c
@@ -214,7 +214,7 @@ static int av1_frame_split_init(AVBSFContext *ctx)
 if (ret < 0)
 return ret;
 
-s->cbc->decompose_unit_types= 
(CodedBitstreamUnitType*)decompose_unit_types;
+s->cbc->decompose_unit_types= decompose_unit_types;
 s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
 
 if (!ctx->par_in->extradata_size)
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 181ff3a1be..6a76ffb7bc 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -191,7 +191,7 @@ static av_cold int av1_parser_init(AVCodecParserContext 
*ctx)
 if (ret < 0)
 return ret;
 
-s->cbc->decompose_unit_types= (CodedBitstreamUnitType 
*)decompose_unit_types;
+s->cbc->decompose_unit_types= decompose_unit_types;
 s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
 
 return 0;
diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h
index 3fd0a0ef33..f022282b75 100644
--- a/libavcodec/cbs.h
+++ b/libavcodec/cbs.h
@@ -196,7 +196,7 @@ typedef struct CodedBitstreamContext {
  * Types not in this list will be available in bitstream form only.
  * If NULL, all supported types will be decomposed.
  */
-CodedBitstreamUnitType *decompose_unit_types;
+const CodedBitstreamUnitType *decompose_unit_types;
 /**
  * Length of the decompose_unit_types array.
  */

___
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: add vvc codec id and profiles

2021-01-11 Thread Nuo Mi
ffmpeg | branch: master | Nuo Mi  | Tue Jan 12 00:33:10 
2021 +0800| [ebdd33086adc9899959840b616480c42c80653ce] | committer: James Almer

avcodec: add vvc codec id and profiles

Signed-off-by: James Almer 

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

 doc/APIchanges  | 3 +++
 libavcodec/avcodec.h| 3 +++
 libavcodec/codec_desc.c | 8 
 libavcodec/codec_id.h   | 2 ++
 libavcodec/profiles.c   | 6 ++
 libavcodec/profiles.h   | 1 +
 libavcodec/version.h| 4 ++--
 7 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 6c1d73515a..bbf56a5385 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2021-01-11 - xx - lavc 58.116.100 - avcodec.h
+  Add FF_PROFILE_VVC_MAIN_10 and FF_PROFILE_VVC_MAIN_10_444.
+
 2020-xx-xx - xx - lavu 56.63.100 - video_enc_params.h
   Add AV_VIDEO_ENC_PARAMS_MPEG2
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 1d3099d50a..fdb4276260 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1961,6 +1961,9 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE  3
 #define FF_PROFILE_HEVC_REXT4
 
+#define FF_PROFILE_VVC_MAIN_10  1
+#define FF_PROFILE_VVC_MAIN_10_444 33
+
 #define FF_PROFILE_AV1_MAIN 0
 #define FF_PROFILE_AV1_HIGH 1
 #define FF_PROFILE_AV1_PROFESSIONAL 2
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 14757bf31b..a7594f9004 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1426,6 +1426,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP) version 2"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_VVC,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "vvc",
+.long_name = NULL_IF_CONFIG_SMALL("H.266 / VVC (Versatile Video 
Coding)"),
+.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+.profiles  = NULL_IF_CONFIG_SMALL(ff_vvc_profiles),
+},
 {
 .id= AV_CODEC_ID_Y41P,
 .type  = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 6133e03bb9..7a8a896bfe 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -244,6 +244,8 @@ enum AVCodecID {
 AV_CODEC_ID_PGX,
 AV_CODEC_ID_AVS3,
 AV_CODEC_ID_MSP2,
+AV_CODEC_ID_VVC,
+#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
 
 AV_CODEC_ID_Y41P = 0x8000,
 AV_CODEC_ID_AVRP,
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index e59a3a5c12..7af7fbeb13 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -74,6 +74,12 @@ const AVProfile ff_h264_profiles[] = {
 { FF_PROFILE_UNKNOWN },
 };
 
+const AVProfile ff_vvc_profiles[] = {
+{ FF_PROFILE_VVC_MAIN_10,   "Main 10" },
+{ FF_PROFILE_VVC_MAIN_10_444,   "Main 10 4:4:4" },
+{ FF_PROFILE_UNKNOWN },
+};
+
 const AVProfile ff_hevc_profiles[] = {
 { FF_PROFILE_HEVC_MAIN, "Main"},
 { FF_PROFILE_HEVC_MAIN_10,  "Main 10" },
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index 6baaba5701..41a19aa9ad 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -61,6 +61,7 @@ extern const AVProfile ff_dca_profiles[];
 extern const AVProfile ff_dnxhd_profiles[];
 extern const AVProfile ff_h264_profiles[];
 extern const AVProfile ff_hevc_profiles[];
+extern const AVProfile ff_vvc_profiles[];
 extern const AVProfile ff_jpeg2000_profiles[];
 extern const AVProfile ff_mpeg2_video_profiles[];
 extern const AVProfile ff_mpeg4_video_profiles[];
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 5b92afe60a..1420439044 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR 115
-#define LIBAVCODEC_VERSION_MICRO 102
+#define LIBAVCODEC_VERSION_MINOR 116
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

___
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/cbs_h265: fix undef SEI_TYPE_X

2021-01-11 Thread Nuo Mi
ffmpeg | branch: master | Nuo Mi  | Tue Jan 12 00:33:13 
2021 +0800| [71de4ebedefda1cd9aef1ba60b3e04fc5f1992ce] | committer: James Almer

avcodec/cbs_h265: fix undef SEI_TYPE_X

Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/cbs_h265_syntax_template.c 
b/libavcodec/cbs_h265_syntax_template.c
index 48fae82d04..c0e94683a2 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -2197,7 +2197,9 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, 
RWContext *rw,
  1, 0, 
alternative_transfer_characteristics);
 SEI_TYPE_N(ALPHA_CHANNEL_INFO,   1, 0, alpha_channel_info);
 
-#undef SEI_TYPE
+#undef SEI_TYPE_N
+#undef SEI_TYPE_S
+#undef SEI_TYPE_E
 default:
 {
 #ifdef READ

___
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/cbs_h2645: Move zero_byte check to its own function

2021-01-11 Thread Nuo Mi
ffmpeg | branch: master | Nuo Mi  | Tue Jan 12 00:33:14 
2021 +0800| [2ad21ee9d4d0e50bed2519598127e48206639961] | committer: Mark 
Thompson

avcodec/cbs_h2645: Move zero_byte check to its own function

Signed-off-by: Mark Thompson 

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

 libavcodec/cbs_h2645.c | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 434322492c..550c059ef3 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -1207,6 +1207,22 @@ static int cbs_h265_write_nal_unit(CodedBitstreamContext 
*ctx,
 return 0;
 }
 
+static int cbs_h2645_unit_requires_zero_byte(enum AVCodecID codec_id,
+ CodedBitstreamUnitType type,
+ int nal_unit_index)
+{
+// Section B.1.2 in H.264, section B.2.2 in H.265.
+if (nal_unit_index == 0) {
+// Assume that this is the first NAL unit in an access unit.
+return 1;
+}
+if (codec_id == AV_CODEC_ID_H264)
+return type == H264_NAL_SPS || type == H264_NAL_PPS;
+if (codec_id == AV_CODEC_ID_HEVC)
+return type == HEVC_NAL_VPS || type == HEVC_NAL_SPS || type == 
HEVC_NAL_PPS;
+return 0;
+}
+
 static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag)
 {
@@ -1241,14 +1257,7 @@ static int 
cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx,
 frag->data_bit_padding = unit->data_bit_padding;
 }
 
-if ((ctx->codec->codec_id == AV_CODEC_ID_H264 &&
- (unit->type == H264_NAL_SPS ||
-  unit->type == H264_NAL_PPS)) ||
-(ctx->codec->codec_id == AV_CODEC_ID_HEVC &&
- (unit->type == HEVC_NAL_VPS ||
-  unit->type == HEVC_NAL_SPS ||
-  unit->type == HEVC_NAL_PPS)) ||
-i == 0 /* (Assume this is the start of an access unit.) */) {
+if (cbs_h2645_unit_requires_zero_byte(ctx->codec->codec_id, 
unit->type, i)) {
 // zero_byte
 data[dp++] = 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] uavformat/rsd: check for EOF in extradata

2021-01-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct 23 18:01:11 2020 +0200| [7186ec88b98bc589f1403985ab10cc7f77461ec8] | 
committer: Michael Niedermayer

uavformat/rsd: check for EOF in extradata

Fixes: OOM
Fixes: 
26503/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6530816735444992

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=7186ec88b98bc589f1403985ab10cc7f77461ec8
---

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

diff --git a/libavformat/rsd.c b/libavformat/rsd.c
index ee0b9557de..9785a55726 100644
--- a/libavformat/rsd.c
+++ b/libavformat/rsd.c
@@ -131,6 +131,8 @@ static int rsd_read_header(AVFormatContext *s)
 return ret;
 
 for (i = 0; i < par->channels; i++) {
+if (avio_feof(pb))
+return AVERROR_EOF;
 avio_read(s->pb, st->codecpar->extradata + 32 * i, 32);
 avio_skip(s->pb, 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] avutil/eval: Unconditionally check argument of e_div

2021-01-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Oct 20 20:33:50 2020 +0200| [90e4862ffa5457ebee53345b9a52df5fd3842ccf] | 
committer: Michael Niedermayer

avutil/eval: Unconditionally check argument of e_div

Fixes: division by zero
Fixes: 
26451/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-4756955832516608

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=90e4862ffa5457ebee53345b9a52df5fd3842ccf
---

 libavutil/eval.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/eval.c b/libavutil/eval.c
index d527f6a9d0..aaa8eb4945 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -317,7 +317,7 @@ static double eval_expr(Parser *p, AVExpr *e)
 case e_lte: return e->value * (d <= d2 ? 1.0 : 0.0);
 case e_pow: return e->value * pow(d, d2);
 case e_mul: return e->value * (d * d2);
-case e_div: return e->value * ((!CONFIG_FTRAPV || d2 ) ? (d / 
d2) : d * INFINITY);
+case e_div: return e->value * (d2 ? (d / d2) : d * INFINITY);
 case e_add: return e->value * (d + d2);
 case e_last:return e->value * d2;
 case e_st : return e->value * (p->var[av_clip(d, 0, VARS-1)]= 
d2);

___
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/utils: wrap_timestamp() is only needed for less than 64 bits

2021-01-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct 23 10:53:18 2020 +0200| [b0259aa248e44dcc6960fa340d6377dd80026105] | 
committer: Michael Niedermayer

avformat/utils: wrap_timestamp() is only needed for less than 64 bits

Fixes: shift exponent 64 is too large for 64-bit type 'unsigned long long'
Fixes: 
26497/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5690188355076096
Fixes: 
26903/clusterfuzz-testcase-minimized-ffmpeg_dem_LUODAT_fuzzer-5641466929741824

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

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c52f39e1b7..d193f9e85f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -101,7 +101,7 @@ static int is_relative(int64_t ts) {
  */
 static int64_t wrap_timestamp(const AVStream *st, int64_t timestamp)
 {
-if (st->internal->pts_wrap_behavior != AV_PTS_WRAP_IGNORE &&
+if (st->internal->pts_wrap_behavior != AV_PTS_WRAP_IGNORE && 
st->pts_wrap_bits < 64 &&
 st->internal->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != 
AV_NOPTS_VALUE) {
 if (st->internal->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET &&
 timestamp < st->internal->pts_wrap_reference)

___
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/aaxdec: Check string before strcmp()

2021-01-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct 23 18:05:23 2020 +0200| [fcc263caa9e11a1f94431a6d356a48003c636ef6] | 
committer: Michael Niedermayer

avformat/aaxdec: Check string before strcmp()

Fixes: NULL ptr dereference
Fixes: 
26508/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-5694725249826816

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

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

diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c
index 3db6e9bc6d..7d10e805ca 100644
--- a/libavformat/aaxdec.c
+++ b/libavformat/aaxdec.c
@@ -232,7 +232,7 @@ static int aax_read_header(AVFormatContext *s)
 int64_t col_offset;
 int flag, type;
 
-if (strcmp(a->xcolumns[c].name, "data"))
+if (!a->xcolumns[c].name || strcmp(a->xcolumns[c].name, "data"))
 continue;
 
 type = a->xcolumns[c].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/mxfdec: Free all types for both Descriptors

2021-01-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Oct 20 20:22:48 2020 +0200| [88519be8db66811e203408b413d9039ac9c3fe91] | 
committer: Michael Niedermayer

avformat/mxfdec: Free all types for both Descriptors

Fixes: memleak
Fixes: 
26352/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5201158714687488

Suggested-by: Tomas Härdin 
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=88519be8db66811e203408b413d9039ac9c3fe91
---

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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 784f43d6d1..4c932e954c 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -343,11 +343,10 @@ static void mxf_free_metadataset(MXFMetadataSet **ctx, 
int freectx)
 MXFIndexTableSegment *seg;
 switch ((*ctx)->type) {
 case Descriptor:
+case MultipleDescriptor:
 av_freep(&((MXFDescriptor *)*ctx)->extradata);
 av_freep(&((MXFDescriptor *)*ctx)->mastering);
 av_freep(&((MXFDescriptor *)*ctx)->coll);
-break;
-case MultipleDescriptor:
 av_freep(&((MXFDescriptor *)*ctx)->sub_descriptors_refs);
 break;
 case Sequence:

___
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/allformats: test pointer to be used

2021-01-11 Thread AlexisWilke
ffmpeg | branch: master | AlexisWilke  | Mon Jan  4 10:11:01 
2021 -0800| [ca21cb1e36ccae2ee71d4299d477fa9284c1f551] | committer: James Almer

avformat/allformats: test pointer to be used

Two tests check the opposite pointer before using it. If only one of these
is set to a valid pointer, one of these functions will crash, the other will
ignore the pointer.

Signed-off-by: James Almer 

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

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

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0e0caaad39..6990af55f4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -541,7 +541,7 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
 
 if (i < size) {
 f = muxer_list[i];
-} else if (indev_list) {
+} else if (outdev_list) {
 f = outdev_list[i - size];
 }
 
@@ -558,7 +558,7 @@ const AVInputFormat *av_demuxer_iterate(void **opaque)
 
 if (i < size) {
 f = demuxer_list[i];
-} else if (outdev_list) {
+} else if (indev_list) {
 f = indev_list[i - size];
 }
 

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