On Sun, 18 Aug 2013, Luca Barbato wrote:
On 18/08/13 16:21, Martin Storsjö wrote:
On Sun, 18 Aug 2013, Luca Barbato wrote:
Do not segfault when writing tracks such as tmcd by writing them down
as generic DataHandlers if not known.
---
libavformat/movenc.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d3aa3db..6ac5a41 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1239,11 +1239,12 @@ static int mov_write_hdlr_tag(AVIOContext *pb,
MOVTrack *track)
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = avio_tell(pb);
- if (!track) { /* no media --> data handler */
- hdlr = "dhlr";
- hdlr_type = "url ";
- descr = "DataHandler";
- } else {
+ /* no media --> data handler */
+ hdlr = "dhlr";
+ hdlr_type = "url ";
+ descr = "DataHandler";
+
Why is this necessary? Since you below make sure all the fields either
are set or we return without trying to use them, this hunk shouldn't be
necessary as far as I can see?
It is more or less a one or the other.
Either we keep the above values as default or we return on unhanded cases.
Yeah, that's my point - if we add both of them, one of them becomes
unnecessary, which is what had me puzzled when reading the patch (when
this wasn't mentioned/explained in the commit message).
This part looks good to me.
So you prefer not writing instead of writing default.
Actually I think it's better the other way around - keep the default and
remove the "else log; return" part.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel