[FFmpeg-trac] #10459(avfilter:closed): set_string_bool() overwrites memory.
FFmpeg
trac at avcodec.org
Fri Jul 14 00:14:33 EEST 2023
#10459: set_string_bool() overwrites memory.
------------------------------------+------------------------------------
Reporter: Wodzu | Owner: (none)
Type: defect | Status: closed
Priority: normal | Component: avfilter
Version: git-master | Resolution: invalid
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Comment (by Wodzu):
Replying to [comment:7 Balling]:
Hi, thank you for the comment. In my opinion the purpose of using
different types (including bool) is to better express your design, thus to
write better code at the end. This faulty bug that I've created is a good
example why a given type should represent as closely as possible the
meaning of variable that it is used for. If it would, I wouldn't be
confused and waste peoples time by issuing this"bug" report. But I
understand, that ffmpeg probably was created when bool was just added to
the C standard hence its representation by four bytes.
I know that this is not the place to discuss patches but I still think,
that set_string_bool(void *obj, const AVOption *o, const char *val, int
*dst) could be changed to work on uint8_t and the behaviour that I've
observed would be fixed (unless you want to keep an int value instead of
bool value in an option of kind AV_OPT_TYPE_BOOL which is really what
should not be done). Actually, I did that, recompiled and everything
worked fine.
Cheers!
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10459#comment:8>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list