[FFmpeg-devel] lavf/hlsdec: fix support for large initialization segments

Submitted by Rodger Combs on March 1, 2019, 7:19 a.m.

Details

Message ID 20190301071956.56091-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs March 1, 2019, 7:19 a.m.
---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Liu March 1, 2019, 11:57 a.m.
> 在 2019年3月1日,下午3:19,Rodger Combs <rodger.combs@gmail.com> 写道:
> 
> ---
> libavformat/hls.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index fc9110356d..c56ead507b 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -1553,7 +1553,7 @@ reload:
>     if (v->init_sec_buf_read_offset < v->init_sec_data_len) {
>         /* Push init section out first before first actual segment */
>         int copy_size = FFMIN(v->init_sec_data_len - v->init_sec_buf_read_offset, buf_size);
> -        memcpy(buf, v->init_sec_buf, copy_size);
> +        memcpy(buf, v->init_sec_buf + v->init_sec_buf_read_offset, copy_size);
>         v->init_sec_buf_read_offset += copy_size;
>         return copy_size;
>     }
> -- 
> 2.20.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


LGTM

Thanks
Steven

Patch hide | download patch | download mbox

diff --git a/libavformat/hls.c b/libavformat/hls.c
index fc9110356d..c56ead507b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1553,7 +1553,7 @@  reload:
     if (v->init_sec_buf_read_offset < v->init_sec_data_len) {
         /* Push init section out first before first actual segment */
         int copy_size = FFMIN(v->init_sec_data_len - v->init_sec_buf_read_offset, buf_size);
-        memcpy(buf, v->init_sec_buf, copy_size);
+        memcpy(buf, v->init_sec_buf + v->init_sec_buf_read_offset, copy_size);
         v->init_sec_buf_read_offset += copy_size;
         return copy_size;
     }