diff mbox series

[FFmpeg-devel,2/4] avformat/mov: Do not try and seek to an mfra if the reader can't seek

Message ID 20200901150335.103855-2-derek.buitenhuis@gmail.com
State Accepted
Commit 19064a36e39a113568cb4ea2d581747fd43e055a
Headers show
Series [FFmpeg-devel,1/4] avformat/mov: Fix return type used for av_seek in mfra code | expand

Checks

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

Commit Message

Derek Buitenhuis Sept. 1, 2020, 3:03 p.m. UTC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Sept. 1, 2020, 3:37 p.m. UTC | #1
On 9/1/2020 12:03 PM, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  libavformat/mov.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index f0b4edc2ed..49c2d05d21 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -5094,7 +5094,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  
>      // See if the remaining bytes are just an mfra which we can ignore.
>      is_complete = offset == stream_size;
> -    if (!is_complete) {
> +    if (!is_complete && (pb->seekable & AVIO_SEEKABLE_NORMAL)) {

LGTM.

>          int64_t ret;
>          int64_t original_pos = avio_tell(pb);
>          int32_t mfra_size;
>
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f0b4edc2ed..49c2d05d21 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5094,7 +5094,7 @@  static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     // See if the remaining bytes are just an mfra which we can ignore.
     is_complete = offset == stream_size;
-    if (!is_complete) {
+    if (!is_complete && (pb->seekable & AVIO_SEEKABLE_NORMAL)) {
         int64_t ret;
         int64_t original_pos = avio_tell(pb);
         int32_t mfra_size;