Frame sizes in ID3v2.3 are not synchsafe, they are simply 32be numbers. In practice this bug is not noticeable unless the frame size takes more than 7 bits (which is almost never for text frames).
This will allow writing the tag in several steps, needed for writing attached pictures.
It has no need of full AVFormatContext.
Signed-off-by: Diego Biurrun <diego@biurrun.de>