Skip to content

Commit

Permalink
tests/libav: test to make sure no avpixfmt crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
haasn committed Feb 4, 2023
1 parent 4272161 commit 723fd77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tests/libav.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ int main()
struct pl_plane_data data[4] = {0};
struct pl_bit_encoding bits;

// Make sure we don't crash on any av pixfmt
const AVPixFmtDescriptor *desc = NULL;
while ((desc = av_pix_fmt_desc_next(desc)))
pl_plane_data_from_pixfmt(data, &bits, av_pix_fmt_desc_get_id(desc));

#define TEST(pixfmt, reference) \
do { \
int planes = pl_plane_data_from_pixfmt(data, &bits, pixfmt); \
Expand Down

0 comments on commit 723fd77

Please sign in to comment.