diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-12-29 22:09:59 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-12-30 22:19:04 +0100 |
commit | 36e61e24e7ac737b38c4382d439329352d9e0c29 (patch) | |
tree | a3a478a143dcbb3d4d386fabfa1513487543c438 /libavcodec/internal.h | |
parent | e911f4ae720afe4a090ded2b165647734f0320ef (diff) | |
download | ffmpeg-36e61e24e7ac737b38c4382d439329352d9e0c29.tar.gz |
lavc: add ff_bprint_to_extradata() helper and use it.
This commit also makes sure the extradata and subtitle_header are NUL
terminated, without taking into account the trailing '\0' in account in
the size.
At the same time, it should fix 'warning: dereferencing type-punned
pointer will break strict-aliasing rules' warning for compilers who
don't consider uint8_t** and char** compatibles.
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r-- | libavcodec/internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 2d3433f434..386f6f3c26 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -201,4 +201,9 @@ int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDict */ int ff_codec_close_recursive(AVCodecContext *avctx); +/** + * Finalize buf into extradata and set its size appropriately. + */ +int ff_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf); + #endif /* AVCODEC_INTERNAL_H */ |