diff mbox series

[FFmpeg-devel] avformat/rtsp: Don't free uninitialized AVBPrint

Message ID 20200420013305.22311-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 87b056e6af0ccebc6813c54c88b5eb78ac06faf2
Headers show
Series [FFmpeg-devel] avformat/rtsp: Don't free uninitialized AVBPrint | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 20, 2020, 1:33 a.m. UTC
Fixes Coverity ID 1462307.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
I intend to apply this soon if there are no objections.

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

Comments

Marton Balint April 20, 2020, 7:53 a.m. UTC | #1
On Mon, 20 Apr 2020, Andreas Rheinhardt wrote:

> Fixes Coverity ID 1462307.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> I intend to apply this soon if there are no objections.
>
> libavformat/rtsp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 49f7644fab..0a6462000d 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -2567,8 +2567,8 @@ static int rtp_read_header(AVFormatContext *s)
> fail_nobuf:
>     ret = AVERROR(ENOMEM);
>     av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for sdp-headers\n");
> -fail:
>     av_bprint_finalize(&sdp, NULL);
> +fail:
>     avcodec_parameters_free(&par);
>     if (in)
>         ffurl_close(in);

LGTM thanks. I guess this rtsp fix has a series of bad luck :)

Regards,
Marton
Ross Nicholson April 20, 2020, 10:23 a.m. UTC | #2
> On 20 Apr 2020, at 08:53, Marton Balint <cus@passwd.hu> wrote:
> 
> 
> 
>> On Mon, 20 Apr 2020, Andreas Rheinhardt wrote:
>> 
>> Fixes Coverity ID 1462307.
>> 
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
>> I intend to apply this soon if there are no objections.
>> 
>> libavformat/rtsp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> index 49f7644fab..0a6462000d 100644
>> --- a/libavformat/rtsp.c
>> +++ b/libavformat/rtsp.c
>> @@ -2567,8 +2567,8 @@ static int rtp_read_header(AVFormatContext *s)
>> fail_nobuf:
>>    ret = AVERROR(ENOMEM);
>>    av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for sdp-headers\n");
>> -fail:
>>    av_bprint_finalize(&sdp, NULL);
>> +fail:
>>    avcodec_parameters_free(&par);
>>    if (in)
>>        ffurl_close(in);
> 
> LGTM thanks. I guess this rtsp fix has a series of bad luck :)

Man, and I was sure the last version was good. Thanks Andreas for fixing up.

> 
> Regards,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Andreas Rheinhardt April 20, 2020, 4:26 p.m. UTC | #3
Marton Balint:
> 
> 
> On Mon, 20 Apr 2020, Andreas Rheinhardt wrote:
> 
>> Fixes Coverity ID 1462307.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
>> I intend to apply this soon if there are no objections.
>>
>> libavformat/rtsp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> index 49f7644fab..0a6462000d 100644
>> --- a/libavformat/rtsp.c
>> +++ b/libavformat/rtsp.c
>> @@ -2567,8 +2567,8 @@ static int rtp_read_header(AVFormatContext *s)
>> fail_nobuf:
>>     ret = AVERROR(ENOMEM);
>>     av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer
>> space for sdp-headers\n");
>> -fail:
>>     av_bprint_finalize(&sdp, NULL);
>> +fail:
>>     avcodec_parameters_free(&par);
>>     if (in)
>>         ffurl_close(in);
> 
> LGTM thanks. I guess this rtsp fix has a series of bad luck :)
> 
> Regards,
> Marton

Applied, thanks.

- Andreas
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 49f7644fab..0a6462000d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2567,8 +2567,8 @@  static int rtp_read_header(AVFormatContext *s)
 fail_nobuf:
     ret = AVERROR(ENOMEM);
     av_log(s, AV_LOG_ERROR, "rtp_read_header(): not enough buffer space for sdp-headers\n");
-fail:
     av_bprint_finalize(&sdp, NULL);
+fail:
     avcodec_parameters_free(&par);
     if (in)
         ffurl_close(in);