mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-27 01:42:20 +00:00
avcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_change()
The function otherwise would initialize the context without setting context_initialized alternatively we could set context_initialized Fixes valgrind anomalies related to ticket 3928 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2762323c37
commit
0d0f7f0ba4
@ -1456,6 +1456,9 @@ int ff_mpv_common_frame_size_change(MpegEncContext *s)
|
|||||||
{
|
{
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
|
if (!s->context_initialized)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
if (s->slice_context_count > 1) {
|
if (s->slice_context_count > 1) {
|
||||||
for (i = 0; i < s->slice_context_count; i++) {
|
for (i = 0; i < s->slice_context_count; i++) {
|
||||||
free_duplicate_context(s->thread_context[i]);
|
free_duplicate_context(s->thread_context[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user