diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index d3e1bc11774595fee72aa201f1ef38608284b22d..29955cc6467cca6f15b44a9f9eeabd822f0efcec 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1158,7 +1158,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
         switch(err) {
             case AC3_PARSE_ERROR_SYNC:
                 av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
-                break;
+                return -1;
             case AC3_PARSE_ERROR_BSID:
                 av_log(avctx, AV_LOG_ERROR, "invalid bitstream id\n");
                 break;