diff mbox series

[FFmpeg-devel,01/10] fftools/ffmpeg_enc: simplify opaque_ref check

Message ID 20240427235424.3075968-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/10] fftools/ffmpeg_enc: simplify opaque_ref check | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer April 27, 2024, 11:54 p.m. UTC
Found-while-revieweing: CID1520670 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 fftools/ffmpeg_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer July 2, 2024, 6:21 p.m. UTC | #1
On Sun, Apr 28, 2024 at 01:54:15AM +0200, Michael Niedermayer wrote:
> Found-while-revieweing: CID1520670 Dereference after null check
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  fftools/ffmpeg_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply the remaining patches of this set

[...]
diff mbox series

Patch

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 618ba193ff5..863d1a43edd 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -476,7 +476,7 @@  void enc_stats_write(OutputStream *ost, EncStats *es,
 
     const FrameData *fd;
 
-    if ((frame && frame->opaque_ref) || (pkt && pkt->opaque_ref)) {
+    if (frame ? frame->opaque_ref : pkt->opaque_ref) {
         fd   = (const FrameData*)(frame ? frame->opaque_ref->data : pkt->opaque_ref->data);
         tbi  = fd->dec.tb;
         ptsi = fd->dec.pts;