avcodec: fix invalid write and memory leak
avcodec: fix invalid write and memory leak

picture.format is set by the allocator of the picture. It cannot be
changed. Indeed, this caused a massive leak (one palette per picture).

xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc