[FFmpeg-devel] [PATCH] avformat/mov: fix sidx size being doubled in offset.

Michael Niedermayer michael at niedermayer.cc
Thu Jan 31 20:47:59 EET 2019


On Sun, Jan 27, 2019 at 11:08:29AM -0500, agrecascino123 at gmail.com wrote:
> From: mptcultist <agrecascino123 at gmail.com>
> 
> fixes an issue where if the video size was very specific, ffmpeg would hang from not filling the sidx_pts for all streams, due to not reading the last sidx lump. for #7572
> 
> ---
>  libavformat/mov.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 9b9739f788..c222582886 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4933,7 +4933,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  
>  static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> -    int64_t offset = avio_tell(pb) + atom.size, pts, timestamp;
> +    int64_t offset = avio_tell(pb), pts, timestamp;
>      uint8_t version;
>      unsigned i, j, track_id, item_count;
>      AVStream *st = NULL;

this breaks fate-mov-frag-encrypted

TEST    mov-frag-encrypted
--- ./tests/ref/fate/mov-frag-encrypted	2019-01-31 18:04:25.857528993 +0100
+++ tests/data/fate/mov-frag-encrypted	2019-01-31 19:44:38.301710624 +0100
@@ -1,57 +0,0 @@
-#format: frame checksums
-#version: 2
-#hash: MD5
-#tb 0: 1/24
-#media_type 0: video
-#codec_id 0: rawvideo
-#dimensions 0: 120x52
-#sar 0: 544/545
-#stream#, dts,        pts, duration,     size, hash
-0,          0,          0,        1,     9360, 920bdc277a6a31c1daed9aca44b10caf
-0,          1,          1,        1,     9360, f1c0b61fef593de57cb97be7fa846569
-0,          2,          2,        1,     9360, 6ef32d9d4398355aebf6d3fb11d51d3f
...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190131/f99fa8f8/attachment.sig>


More information about the ffmpeg-devel mailing list