]> granicus.if.org Git - libx264/commitdiff
ffms: Fix crash if stream properties changes
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 5 Oct 2022 13:36:50 +0000 (16:36 +0300)
committerAnton Mitrofanov <BugMaster@narod.ru>
Wed, 5 Oct 2022 21:12:42 +0000 (00:12 +0300)
input/ffms.c

index 16cb0e18053eae42a90783270c5547f4f1e20d71..a6d72b8e3fa24fc36afeb9dfac03d8e3ef27a53f 100644 (file)
@@ -190,6 +190,10 @@ static int read_frame( cli_pic_t *pic, hnd_t handle, int i_frame )
 
     memcpy( pic->img.stride, frame->Linesize, sizeof(pic->img.stride) );
     memcpy( pic->img.plane, frame->Data, sizeof(pic->img.plane) );
+    int is_fullrange = 0;
+    pic->img.width   = frame->EncodedWidth;
+    pic->img.height  = frame->EncodedHeight;
+    pic->img.csp     = handle_jpeg( frame->EncodedPixelFormat, &is_fullrange ) | X264_CSP_OTHER;
 
     if( h->vfr_input )
     {