Re: [FFmpeg-devel] [PATCH 2/3] avformat/mpeg: Don't copy or leak string in AVBPrint

2019-12-05 Thread Andreas Rheinhardt
Michael Niedermayer:
> On Wed, Dec 04, 2019 at 01:37:13PM +0100, Andreas Rheinhardt wrote:
>> vobsub_read_header() uses an AVBPrint to write a string and up until
>> now, it collected the string stored in the AVBPrint via
>> av_bprint_finalize(), which might involve an allocation and copy of the
>> string. But this is unnecessary, as the lifetime of the returned string
>> does not exceed the lifetime of the AVBPrint. So use the string in the
>> AVBPrint directly.
>>
>> This also makes it possible to easily fix a memleak: In certain error
>> situations, the string stored in the AVBPrint would not be freed (if it
>> was dynamically allocated). This has been fixed, too.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>> Supersedes https://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/252074.html
>> Resending because of merge conflict.
> 
> will apply
> 
> thx
> 
Thanks. During checking whether my patches work I have also found a
use of uninitialized values in vobsub_read_packet() [1]; and earlier I
have found a way to eliminate the secondary packet when reading VobSub
[2]. Could you look over them, too?

- Andreas

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/251961.html
[2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/251146.html

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

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

Re: [FFmpeg-devel] [PATCH 2/3] avformat/mpeg: Don't copy or leak string in AVBPrint

2019-12-05 Thread Michael Niedermayer
On Wed, Dec 04, 2019 at 01:37:13PM +0100, Andreas Rheinhardt wrote:
> vobsub_read_header() uses an AVBPrint to write a string and up until
> now, it collected the string stored in the AVBPrint via
> av_bprint_finalize(), which might involve an allocation and copy of the
> string. But this is unnecessary, as the lifetime of the returned string
> does not exceed the lifetime of the AVBPrint. So use the string in the
> AVBPrint directly.
> 
> This also makes it possible to easily fix a memleak: In certain error
> situations, the string stored in the AVBPrint would not be freed (if it
> was dynamically allocated). This has been fixed, too.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
> Supersedes https://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/252074.html
> Resending because of merge conflict.

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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