avformat/subtitles: Don't increment packet counter prematurely
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 21 Mar 2020 03:50:20 +0000 (04:50 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 22 Mar 2020 12:00:19 +0000 (13:00 +0100)
commit6bd8bcc2ac4c64577d964552317989e61db794d8
tree0bde5d34934c6c4fff498051fb53c63992c1e50f
parent5acef1206144554a48f699b421e8d739e752d8ab
avformat/subtitles: Don't increment packet counter prematurely

Do it only if the packet has been successfully allocated in
av_new_packet() -- otherwise on error a completely uninitialized packet
would be unreferenced later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/subtitles.c