[FFmpeg-devel,1/2] avformat/mpjpegdec: fix finding multipart boundary parameter

Submitted by Moritz Barsnick on May 23, 2019, 4:06 p.m.

Details

Message ID bf4951cfa5aeef47690aeb758e818e2fb496c78d.1558627113.git.barsnick@gmx.net
State New
Headers show

Commit Message

Moritz Barsnick May 23, 2019, 4:06 p.m.
The string matching function's return value was evaluated incorrectly.

Fixes trac #7920.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
---
 libavformat/mpjpegdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.20.1

Comments

Michael Niedermayer May 24, 2019, 9:54 a.m.
On Thu, May 23, 2019 at 06:06:42PM +0200, Moritz Barsnick wrote:
> The string matching function's return value was evaluated incorrectly.
> 
> Fixes trac #7920.
> 
> Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
> ---
>  libavformat/mpjpegdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
> index e653b5cc93..a23469c0ec 100644
> --- a/libavformat/mpjpegdec.c
> +++ b/libavformat/mpjpegdec.c
> @@ -271,7 +271,7 @@ static char* mpjpeg_get_boundary(AVIOContext* pb)
>          while (av_isspace(*start))
>              start++;
> 
> -        if (!av_stristart(start, "boundary=", &start)) {
> +        if (av_stristart(start, "boundary=", &start)) {
>              end = strchr(start, ';');
>              if (end)
>                  len = end - start - 1;

LGTM
a testcase in fate would be good

thx

[...]
Moritz Barsnick May 26, 2019, 8:40 p.m.
On Fri, May 24, 2019 at 11:54:20 +0200, Michael Niedermayer wrote:
> LGTM
> a testcase in fate would be good

Thanks.

Indeed, I'll work on adding a fate testcase next week (have never done
so previously). There's valid input material in the as-yet unsolved
ticket #5023.

Moritz

Patch hide | download patch | download mbox

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index e653b5cc93..a23469c0ec 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -271,7 +271,7 @@  static char* mpjpeg_get_boundary(AVIOContext* pb)
         while (av_isspace(*start))
             start++;

-        if (!av_stristart(start, "boundary=", &start)) {
+        if (av_stristart(start, "boundary=", &start)) {
             end = strchr(start, ';');
             if (end)
                 len = end - start - 1;