#1053 closed defect (invalid)
Crash on avcodec_default_release_buffer
Reported by: | Lastique | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avcodec |
Version: | 0.10 | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
When allocating an internal buffer for an audio frame, audio_get_buffer in libavcodec/utils.c does not increment buffer_count. This results in incorrect behavior of avcodec_default_release_buffer (it attempts to FFSWAP InternalBuffer when buf is NULL) for this frame and consequently a crash with SIGSEGV.
Please, find a simple test case attached that reproduce the problem. Compiled with the following command line:
gcc -o av_internal_buf_crash -lavcodec -lavutil av_internal_buf_crash.c
Attachments (1)
Change History (3)
by , 13 years ago
Attachment: | av_internal_buf_crash.c added |
---|
comment:1 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Why do you call a function that starts with assert(video) on a audio frame ?
ive made sure that the assert is always checked so this produces a clearer error instead of just crashing. And yes the API is not well documented, patches that improve this are welcome.
Iam closing this as invalid, as it seems a misuse of API, but dont hesitate to reopen if you need to call several get buffer and thus release buffer in a decoder. And sorry for the late awnser dunno why ive missed this issue
comment:2 by , 13 years ago
Thanks for the answer. The assert didn't work since I was using a release build available in my Linux distribution. I've already changed my code to not use internal buffers for audio.
A test case to reproduce the problem.