Found while reviewing CID1608712 Explicit null dereferenced
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -546,11 +546,10 @@ start: · 545 unmodified lines | ||
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | err = ff_encode_get_frame(avctx, frame); |
| 549 | − if (err < 0 && err != AVERROR_EOF) | |
| 550 | − return err; | |
| 551 | − | |
| 552 | − if (err == AVERROR_EOF) | |
| 549 | + if (err == AVERROR_EOF) { | |
| 553 | 550 | frame = NULL; |
| 551 | + } else if (err < 0) | |
| 552 | + return err; | |
| 554 | 553 | |
| 555 | 554 | err = hw_base_encode_send_frame(avctx, ctx, frame); |
| 556 | 555 | if (err < 0) |