[PATCH 1/2] avformat/matroskadec: assert non NULL buf
The code is only called if size is > 0 so buf should not be NULL Helps: CID610554 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/matroskadec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4715f1b7d4..de73f97aca 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3701,6 +3701,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf uint64_t num; int trust_default_duration; + av_assert1(buf); + ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL); if ((n = ebml_read_num(matroska, &pb.pub, 8, &num, 1)) < 0) -- 2.17.1
This function needs more cleanup and it lacks error handling Fixes: use of uninitialized memory Fixes: CID700776 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 88e9ef5226..f948f1d395 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -949,6 +949,8 @@ static void rtsp_parse_transport(AVFormatContext *s, ";,", &p); } th->transport = RTSP_TRANSPORT_RAW; + } else { + break; } if (!av_strcasecmp(lower_transport, "TCP")) th->lower_transport = RTSP_LOWER_TRANSPORT_TCP; -- 2.17.1
On Fri, May 20, 2022 at 01:43:12AM +0200, Michael Niedermayer wrote:
This function needs more cleanup and it lacks error handling
Fixes: use of uninitialized memory Fixes: CID700776
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+)
will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle
Michael Niedermayer:
The code is only called if size is > 0 so buf should not be NULL
Helps: CID610554
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/matroskadec.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4715f1b7d4..de73f97aca 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3701,6 +3701,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf uint64_t num; int trust_default_duration;
+ av_assert1(buf); + ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
if ((n = ebml_read_num(matroska, &pb.pub, 8, &num, 1)) < 0)
Ok. - Andreas
On Fri, May 20, 2022 at 09:17:50AM +0200, Andreas Rheinhardt wrote:
Michael Niedermayer:
The code is only called if size is > 0 so buf should not be NULL
Helps: CID610554
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/matroskadec.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4715f1b7d4..de73f97aca 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3701,6 +3701,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf uint64_t num; int trust_default_duration;
+ av_assert1(buf); + ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
if ((n = ebml_read_num(matroska, &pb.pub, 8, &num, 1)) < 0)
Ok.
will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides
participants (2)
-
Andreas Rheinhardt -
Michael Niedermayer