Skip to content

Commit

Permalink
display_gl_get_property: fixed codec array size
Browse files Browse the repository at this point in the history
The source array size was returned, but the codec list is filtered so
the actual number may be lower.
  • Loading branch information
MartinPulec committed Jan 22, 2024
1 parent 45f51f8 commit 9622095
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/video_display/gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,9 +1917,10 @@ display_gl_get_property(void *state, int property, void *val, size_t *len)
}
return true;
};
copy_if(gl_supp_codecs.begin(), gl_supp_codecs.end(),
(codec_t *) val, filter_codecs);
*len = sizeof gl_supp_codecs;
const codec_t *end =
copy_if(gl_supp_codecs.begin(), gl_supp_codecs.end(),
(codec_t *) val, filter_codecs);
*len = (const char *) end - (char *) val;
return true;
}
case DISPLAY_PROPERTY_RGB_SHIFT:
Expand Down

0 comments on commit 9622095

Please sign in to comment.