summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Massiot <cmassiot@openheadend.tv>2014-11-04 20:19:07 +0100
committerChristophe Massiot <cmassiot@openheadend.tv>2014-11-04 20:19:07 +0100
commit8bfc8c31e65d5e9adb5502487a809311bd409ad8 (patch)
tree2cf2c9b1ad7ec5844b2f3fc797d5202f3f70f00b
parentfd3e03f34013733cec948886261f05b4d8bf644a (diff)
fix deadlock in a52 framer0.3
-rw-r--r--lib/upipe-framers/upipe_a52_framer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/upipe-framers/upipe_a52_framer.c b/lib/upipe-framers/upipe_a52_framer.c
index 5fece42..cc48bc9 100644
--- a/lib/upipe-framers/upipe_a52_framer.c
+++ b/lib/upipe-framers/upipe_a52_framer.c
@@ -318,11 +318,14 @@ static bool upipe_a52f_parse_a52(struct upipe *upipe)
A52_SYNCINFO_SIZE, header))))
return true; /* not enough data */
+ ssize_t next_frame_size = a52_get_frame_size(a52_get_fscod(header),
+ a52_get_frmsizecod(header));
+ if (!next_frame_size)
+ return false;
+
if (likely(a52_sync_compare_formats(header, upipe_a52f->sync_header))) {
/* identical sync */
- upipe_a52f->next_frame_size =
- a52_get_frame_size(a52_get_fscod(header),
- a52_get_frmsizecod(header));
+ upipe_a52f->next_frame_size = next_frame_size;
return true;
}
@@ -344,8 +347,7 @@ static bool upipe_a52f_parse_a52(struct upipe *upipe)
}
/* frame size */
- upipe_a52f->next_frame_size = a52_get_frame_size(a52_get_fscod(header),
- a52_get_frmsizecod(header));
+ upipe_a52f->next_frame_size = next_frame_size;
uint64_t octetrate = a52_bitrate_tab[a52_get_frmsizecod(header)] / 8;
memcpy(upipe_a52f->sync_header, header, A52_SYNCINFO_SIZE);