aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-21 03:02:55 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-12 02:55:45 +0100
commit483f5bccc129eaec0f9be8af9e85a895be402bc7 (patch)
tree6c657d2ef00c4d3a97f3651f50431de5e9b4e010
parentce17111ed18dda4193114137c104450e266545e1 (diff)
downloadffmpeg-483f5bccc129eaec0f9be8af9e85a895be402bc7.tar.gz
ffmpeg: Check av_parser_change() for failure
No testcase known Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ac0ba6f233698f02ebb75b03242e94333dbe13d4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--ffmpeg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index c99a014f6e..ce095ed881 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1807,10 +1807,15 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
&& ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG2VIDEO
&& ost->enc_ctx->codec_id != AV_CODEC_ID_VC1
) {
- if (av_parser_change(ost->parser, ost->st->codec,
+ int ret = av_parser_change(ost->parser, ost->st->codec,
&opkt.data, &opkt.size,
pkt->data, pkt->size,
- pkt->flags & AV_PKT_FLAG_KEY)) {
+ pkt->flags & AV_PKT_FLAG_KEY);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "av_parser_change failed\n");
+ exit_program(1);
+ }
+ if (ret) {
opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
if (!opkt.buf)
exit_program(1);