avviddec: fix invalid alignment calculations.
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 2 Jul 2018 02:05:19 +0000 (04:05 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 12 Jul 2018 22:53:27 +0000 (00:53 +0200)
commitbe9b6969cb7d945170b3a05da1a643aad5870f1e
tree4a7dc1eb419d8aaa3bef700a05277133b066efef
parent8562f10969654bd34b187b8d91b4cc80eb47f25b
avviddec: fix invalid alignment calculations.

avcodec_align_dimensions2 uses context->pix_fmt to make its
calculations, we thus need to make sure it is adequately set
when calling it.

Fixes:

gst-launch-1.0 videotestsrc ! video/x-raw, width=1920, height=1080 \
! avenc_mpeg4 ! avdec_mpeg4 ! xvimagesink

This showed invalid writes under valgrind, then segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
ext/libav/gstavviddec.c