diff mbox series

[FFmpeg-devel] new patch

Message ID CAGsMwNBGJpG1cWb6u9YeqF70RaVcKvbrKLPxrcUa-JSYoc6ziA@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] new patch
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

mostafa namazi Feb. 18, 2020, 3:11 p.m. UTC
I found this patch useful for prevent crash in http live stream.
I'm using ffmpeg in my application for show http live when remote address
send invalid data ffmpeg crash in this part and after my change it was
fixed.

Comments

mostafa namazi March 15, 2020, 11:34 a.m. UTC | #1
let me now any progress?

    On Tuesday, February 18, 2020, 6:41:08 PM GMT+3:30, Mostafa Namazi fard <mostafa.mnf98@gmail.com> wrote:  
 
 I found this patch useful for prevent crash in http live stream.I'm using ffmpeg in my application for show http live when remote address send invalid data ffmpeg crash in this part and after my change it was fixed.
Moritz Barsnick March 30, 2020, 12:28 p.m. UTC | #2
On Tue, Feb 18, 2020 at 18:41:08 +0330, Mostafa Namazi fard wrote:
> I found this patch useful for prevent crash in http live stream.
> I'm using ffmpeg in my application for show http live when remote address
> send invalid data ffmpeg crash in this part and after my change it was
> fixed.

Can you post a reproducible example? Actually, it's preferred you open
a bug report for this. This should include a backtrace, as explained
here:
https://ffmpeg.org/bugreports.html

>          if (pls->needed && !pls->pkt.data) {
> -            while (1) {
> +            while (pls->ctx) {

As far as I can tell, pls->ctx should never turn NULL in this loop. I
believe you are just hiding a different root cause.

Regards,
Moritz
diff mbox series

Patch

From 73c61670d6e65ad9f7a354a785f73ff9ad5ffc12 Mon Sep 17 00:00:00 2001
From: Mostafa Namazi <m.namazi@mohaymen.ir>
Date: Tue, 18 Feb 2020 16:14:16 +0330
Subject: [PATCH] crash fixed: live stream.

---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 1f58e745a7..97b1a1db52 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2110,7 +2110,7 @@  static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
         /* Make sure we've got one buffered packet from each open playlist
          * stream */
         if (pls->needed && !pls->pkt.data) {
-            while (1) {
+            while (pls->ctx) {
                 int64_t ts_diff;
                 AVRational tb;
                 ret = av_read_frame(pls->ctx, &pls->pkt);
-- 
2.17.1