diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a46a8d6cfd4271ad24448488ab912d202dc75151..cbb64569c76d5f3c709076cca75387d332e0494e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4569,6 +4569,7 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size);
  */
 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
 
+#if FF_API_MISSING_SAMPLE
 /**
  * Log a generic warning message about a missing feature. This function is
  * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
@@ -4580,7 +4581,9 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
  * If want_sample is non-zero, additional verbage will be added to the log
  * message which tells the user how to report samples to the development
  * mailing list.
+ * @deprecated Use avpriv_report_missing_feature() instead.
  */
+attribute_deprecated
 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
 
 /**
@@ -4590,8 +4593,11 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample);
  * @param[in] avc a pointer to an arbitrary struct of which the first field is
  * a pointer to an AVClass struct
  * @param[in] msg string containing an optional message, or NULL if no message
+ * @deprecated Use avpriv_request_sample() instead.
  */
+attribute_deprecated
 void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
+#endif /* FF_API_MISSING_SAMPLE */
 
 /**
  * Register the hardware accelerator hwaccel.
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 46fc71095eb526d3de3bb0849755a6621cbc3563..64d2e7e16e6af206a53c29bc7ab2a4b4fbdd38c0 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -45,6 +45,7 @@
 #include "frame_thread_encoder.h"
 #include "internal.h"
 #include "bytestream.h"
+#include "version.h"
 #include <stdlib.h>
 #include <stdarg.h>
 #include <limits.h>
@@ -2859,6 +2860,7 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
     return i;
 }
 
+#if FF_API_MISSING_SAMPLE
 void av_log_missing_feature(void *avc, const char *feature, int want_sample)
 {
     av_log(avc, AV_LOG_WARNING, "%s is not implemented. Update your FFmpeg "
@@ -2883,6 +2885,7 @@ void av_log_ask_for_sample(void *avc, const char *msg, ...)
 
     va_end(argument_list);
 }
+#endif /* FF_API_MISSING_SAMPLE */
 
 static AVHWAccel *first_hwaccel = NULL;
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0a2a9094f5bba4ac5dbfde948f2fc31df51ce684..256a2e5500215cd209fce3a210bc3839c966eb48 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -85,5 +85,8 @@
 #ifndef FF_API_GET_BUFFER
 #define FF_API_GET_BUFFER        (LIBAVCODEC_VERSION_MAJOR < 56)
 #endif
+#ifndef FF_API_MISSING_SAMPLE
+#define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
diff --git a/libavutil/internal.h b/libavutil/internal.h
index a105fe6b4453ca4e315795ab5d27662d07cea8eb..6ff14facb5a0eabe40d3e9477772be0ca60a2fa2 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -162,4 +162,25 @@
 #   define ONLY_IF_THREADS_ENABLED(x) NULL
 #endif
 
+/**
+ * Log a generic warning message about a missing feature.
+ *
+ * @param[in] avc a pointer to an arbitrary struct of which the first
+ *                field is a pointer to an AVClass struct
+ * @param[in] msg string containing the name of the missing feature
+ */
+void avpriv_report_missing_feature(void *avc,
+                                   const char *msg, ...) av_printf_format(2, 3);
+
+/**
+ * Log a generic warning message about a missing feature.
+ * Additionally request that a sample showcasing the feature be uploaded.
+ *
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ *                a pointer to an AVClass struct
+ * @param[in] msg string containing the name of the missing feature
+ */
+void avpriv_request_sample(void *avc,
+                           const char *msg, ...) av_printf_format(2, 3);
+
 #endif /* AVUTIL_INTERNAL_H */
diff --git a/libavutil/log.c b/libavutil/log.c
index 700e89fa9774a5095082243d46216455e6d9bc59..a27413444d6a70e1aebd82da23d61b1bd2bd11e7 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -32,9 +32,11 @@
 #if HAVE_IO_H
 #include <io.h>
 #endif
+#include <stdarg.h>
 #include <stdlib.h>
 #include "avutil.h"
 #include "common.h"
+#include "internal.h"
 #include "log.h"
 
 #define LINE_SZ 1024
@@ -278,3 +280,40 @@ void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
 {
     av_log_callback = callback;
 }
+
+static void missing_feature_sample(int sample, void *avc, const char *msg, ...)
+{
+    va_list argument_list;
+
+    va_start(argument_list, msg);
+
+    av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
+    av_log(avc, AV_LOG_WARNING, " is not implemented. Update your FFmpeg "
+           "version to the newest one from Git. If the problem still "
+           "occurs, it means that your file has a feature which has not "
+           "been implemented.\n");
+    if (sample)
+        av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
+               "of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ "
+               "and contact the ffmpeg-devel mailing list.\n");
+
+    va_end(argument_list);
+}
+
+void avpriv_request_sample(void *avc, const char *msg, ...)
+{
+    va_list argument_list;
+
+    va_start(argument_list, msg);
+    missing_feature_sample(1, avc, msg, argument_list);
+    va_end(argument_list);
+}
+
+void avpriv_report_missing_feature(void *avc, const char *msg, ...)
+{
+    va_list argument_list;
+
+    va_start(argument_list, msg);
+    missing_feature_sample(0, avc, msg, argument_list);
+    va_end(argument_list);
+}
diff --git a/tools/ismindex.c b/tools/ismindex.c
index 540aca2c68a3d6aa08acfe69fa9820ae269364bc..502a7dc2b1de9b25e9cdfde9f4df4620d0795d3a 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -305,10 +305,21 @@ static int handle_file(struct Tracks *tracks, const char *file, int split)
         tracks->duration = ctx->duration;
 
     for (i = 0; i < ctx->nb_streams; i++) {
+        struct Track **temp;
         AVStream *st = ctx->streams[i];
         track = av_mallocz(sizeof(*track));
-        tracks->tracks = av_realloc(tracks->tracks,
-                                    sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
+        if (!track) {
+            err = AVERROR(ENOMEM);
+            goto fail;
+        }
+        temp = av_realloc(tracks->tracks,
+                          sizeof(*tracks->tracks) * (tracks->nb_tracks + 1));
+        if (!temp) {
+            av_free(track);
+            err = AVERROR(ENOMEM);
+            goto fail;
+        }
+        tracks->tracks = temp;
         tracks->tracks[tracks->nb_tracks] = track;
 
         track->name = file;